Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXIF-based autorotation is broken in @jimp/custom #873

Closed
skalee opened this issue Apr 11, 2020 · 0 comments
Closed

EXIF-based autorotation is broken in @jimp/custom #873

skalee opened this issue Apr 11, 2020 · 0 comments

Comments

@skalee
Copy link
Contributor

skalee commented Apr 11, 2020

Expected Behavior

Jimp.read() should autorotate images basing on their EXIF data. This feature does not work properly in @jimp/custom. Whereas it is understandable that this feature may require some plugins, it is not documented which ones are actually needed.

Current Behavior

Works correctly for orientations 1 (no action), 2, and 4 (ones which only require mirroring). For remaining orientations (which require rotating), images have incorrect dimensions, and their bitmaps are empty (all bytes are zeros).

Failure Information (for bugs)

Steps to Reproduce

Consider testexif.js script in this gist: https://gist.github.com/skalee/7dc467bf1f097e5b719e05c2ce877251. It is a Node.js script, which should be executed in a directory containing these Landscape_*.jpg pictures: https://github.com/oliver-moran/jimp/tree/master/packages/jimp/test/images/exif-orientation.

Context

  • Jimp Version: 0.10.1
  • Operating System: macOS High Sierra (10.13.6)
  • Node version: v13.12.0

Note 1: I am using @jimp/custom with flip and rotate plugins and all available types (@jimp/types). In my understanding of exifRotate() function, this should be enough, but is not:

https://github.com/oliver-moran/jimp/blob/44ce60b5cc53ee60cd5c63d4dc0ecf26fd3d431e/packages/core/src/utils/image-bitmap.js#L31-L63

Note 2: Switching to full-blown jimp works the issue arround.

Failure Logs

See gist.

Additional notes

This may be a bug in the rotate plugin — perhaps it has some unspecified dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants