this post was submitted on 04 Mar 2025
7 points (100.0% liked)

Explain Like I'm Five

15117 readers
8 users here now

Simplifying Complexity, One Answer at a Time!

Rules

  1. Be respectful and inclusive.
  2. No harassment, hate speech, or trolling.
  3. Engage in constructive discussions.
  4. Share relevant content.
  5. Follow guidelines and moderators' instructions.
  6. Use appropriate language and tone.
  7. Report violations.
  8. Foster a continuous learning environment.

founded 2 years ago
MODERATORS
 

In Kotlin, I can set a bitmap to be 500x500 and use ScaledBitmap to load an image in to it at that size without wasted memory junk as far as I know.

Now I am trying to do this in javascript so I can have my website display it's images to scaled sizes of my choosing without having to load the full size of every image first or manually making and uploading multiple sizes.

Everything I'm seeing says there is no way in JS. My ELI5 here is WHY? What makes Kotlin have this but not JS?

sloplike screenshots for reference

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 2 days ago (1 children)
[–] [email protected] 2 points 2 days ago

If you’re interested Vite is a common build tool for preprocessing a bunch of different files so they can be served efficiently—and there’s plugins for it for image processing where everything is handled automatically