1

Last year I found an old JS function by hMatoba from a previous question thread that allows client-side resizing of JPEGs before uploads. This is very useful when EXIF data is needed on the server-side, and when images larger than a certain size are not needed.

This worked very well until Chromium's switch to respecting EXIF image orientation, this library now creates images that cut off part of the image. See here for an example: https://i.stack.imgur.com/WTMQe.jpg. The library continues to work fine in IE (which is a bit useless in 2020...), but fails in Chrome and Edge (Chromium).

I feel like the issue is when the image object is created in the function and loaded with file data, there's a conflict between what the browser presents as "width" and "height" and what the EXIF data shows. Unfortunately, I can't figure out exactly where the fix needs to be implemented. Anyone care to help, or know if an alternative?

0pt1m1z3
  • 841
  • 3
  • 12
  • 23

0 Answers0