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

Image orientation is still incorrect in annotation tool #931

Closed
davidsean opened this issue Sep 24, 2024 · 2 comments
Closed

Image orientation is still incorrect in annotation tool #931

davidsean opened this issue Sep 24, 2024 · 2 comments

Comments

@davidsean
Copy link

davidsean commented Sep 24, 2024

(This is copied from my Q&A community discussion that I think now fits better as an issue)

Hello,
I have some issues showing the correct image orientation (portrait shows up as landscape). This happens for some images, but not all. After some digging in the EXIF metadata, I noticed that way the image was saved differed depending on some of my users. For some, the image was natively saved as as portrait ( Image Width:3024 Image Height:4032) and for the faulty ones, natively saved as landscape, but with an orientation (Image Width:4032, Image Height:3024, Orientation: Rotate 90 CW).

On Biigle, it looks like the image canvas is setup in landscape, but the image data is rendered in portrait (the image is cropped and there is a slice of empty pixels. I am running version v3.72.4

image

I have a self-hosted biigle deployment using a self hosted image server. I do not have SSL setup on my private network, I initially saw the CORS warning, but added the needed headers (Header set Access-Control-Allow-Origin "*") on my image server's apache configuration. I strongly suspect it may be related to #351 . But I think, CORS is setup correctly since the warning no longer shows up.

A temporary fix I am considering, is to write a script that will rotate and produce native portrait images. I feel there is a better way to support the EXIF orientation. Perhaps I am missing something in the headers related to CORS ?

EDIT: I just saw #834 which is not in the version I am running. I will update Biigle and post my findings.
The update worked. The image is no longer cropped on the canvas like my screenshot. HOWEVER, the original image is meant to be in portrait (but is shown in landscape).
image

@mzur
Copy link
Member

mzur commented Sep 25, 2024

In BIIGLE, the image should be displayed as the bytes are stored, ignoring the EXIF metadata. The reason for this is that browsers handle the metadata differently and the images may be rotated in one browser and not in the other, resulting in incorrect annotations. Ignoring the metadata is the only way to display the image correctly everywhere.

How is the image displayed in BIIGLE in your case? Is the EXIF rotation ignored or is it applied? The former would be as expected but the latter would be a bug (again).

@davidsean
Copy link
Author

ok, I misunderstood ignoring orientation was the intended behaviour. I'll rotate the bytes from the concerned images on disk.

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