nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
988 stars 77 forks source link

Dimensions wrong if image orientation isn't default #26

Closed designbyadrian closed 6 years ago

designbyadrian commented 6 years ago

The results from width/height are swapped if the image is rotated. Any plans of reading the EXIF data of an image to remedy this issue?

puzrin commented 6 years ago

Sorry, deep jpeg parse is currently out of this package scope. Orientation is not required everytime. If you need orientation, you should use extra libs. Here is example of code we use in own projects:

https://github.com/nodeca/nodeca.users/blob/4039626af0728229f58b80d8c9e5bab7efda2af5/client/users/avatar/change/change.js#L463-L469