TwelveMonkeys icon indicating copy to clipboard operation
TwelveMonkeys copied to clipboard

Support automatic JPEG rotation according to Exif data

Open jforjava1981 opened this issue 8 years ago • 8 comments

Would love to see this feature implemented as most of phone and digi cams use exif to indicate rotation and not all browsers support image-rotation css property to read exif and rotate it accordingly. It becomes a pain for a website like I am working on where users upload photos using digicams and photos and we have to take extra unnecessary steps to honour the exif while showing it.

I see a todo as well in JPEG reader. Hope it gets removed soon :)

jforjava1981 avatar Nov 01 '16 14:11 jforjava1981

Thanks for putting it on the list!

Might happen some day. :-)

See this Stack Overflow question for background.

Best regards,

Harald K

haraldk avatar Nov 01 '16 18:11 haraldk

I propose that if automatic rotation is implemented, it should be a feature which is deactivated as default. For simple image reading automatic rotation is not a problem. But on more complex scenarios, when metadata is handled explicitly, this at least affects width and height, which then differ from the read image. At least in my case I want to read the image as stored and handle such things myself where needed.

And to promote it: For 3.3 I've added some utility methods in the contrib-module, which already help with image orientation. :-) BufferedImage com.twelvemonkeys.contrib.tiff.TIFFUtilities.applyOrientation(BufferedImage input, int orientation)

Schmidor avatar Nov 02 '16 12:11 Schmidor

@Schmidor Good point promoting the utility method! 😀

Of course, should this be implemented, we also need to take orientation into account for the getWidth()/getHeight() methods, the meta data etc. It's a lot of work, and not always straight forward... See the issues and pros/cons from the SO question above.

However, if we disable it by default, it's not that useful... It must work using just ImageIO.read(...), which is what 90% of the library's users ever does. Maybe a way to disable it would be better.

Anyway, I'm not starting implementing this feature tomorrow... ;-)

Harald K

haraldk avatar Nov 02 '16 12:11 haraldk

Hi, are there still plans to implement this? It would be nice if it's handled automatically including the correct (rotated) width and height

asc75 avatar Jul 09 '18 14:07 asc75

@asc75 It's on the "nice to have" list, but not part of any planned milestone or anything.

haraldk avatar Aug 02 '18 08:08 haraldk

Hi, this feature is still wanted ;)

asc75 avatar Oct 24 '19 09:10 asc75

Would be useful

dProvenzano avatar Feb 07 '22 14:02 dProvenzano