coralnet
coralnet copied to clipboard
'Respect EXIF orientation' option at source level
The changes in issues #107, #332, and #333 would ensure that we consistently ignore image EXIF orientation everywhere. That's certainly respectable, but then we might ask: would any CoralNet users want to display their benthic images with EXIF orientation respected? After all, browsers are making EXIF-respecting the default behavior for webpage images, and surely they must have a decent reason to do so.
So that might point to a source-level 'Respect EXIF orientation' option, which can be turned on or off. For simplicity, I think such an option should deal purely with how things are displayed, without changing how essential data (original image files and point positions) is stored.
The option would affect:
-
The annotation tool image and points display. This means the image would either be rotated or not, and the point positions have to be 'rotated' or not as well. The point-rotation logic can either happen on the Python side or the Javascript side. Since the image has to be downloaded on the Javascript side anyway, it would probably be more performant to let the Javascript detect the EXIF and do the point rotation.
-
The annotation area edit UI, where you manually edit the annotation area for a specific image. The image would either be rotated or not, and the draggable area box would either be rotated or not.
-
Thumbnail displays everywhere else in the source, including Browse Images and perhaps even Browse Patches. This can either be done by deleting all generated thumbnails when the source-level option is changed, or by encoding EXIF orientation metadata into the thumbnails (which feels icky to me for some reason, but I guess it would be valid).
Points and annotation areas would still be stored in unrotated coordinates.
It gets trickier when we display annotation areas as text, or export point positions. The simplest, most obvious thing to do is to just ignore EXIF orientation for those purposes. But I can't help but wonder if the dissonance is just too much when the annotation area edit page has fields labeled "Left boundary X" and "Top boundary Y", and visually they are really "Bottom boundary Y" and "Left boundary X" respectively since the image is EXIF-rotated 90 degrees.
Suppose we just changed the field names on that annotation area edit page, and left everything else alone. Then you set the area as X 100-900 and Y 300-700, but come back to the Image Details page and it says that you set the area as X 300-700 and Y 100-900. Okay, so let's display that Image Details text in rotated coordinates too. But the Image Details page also shows the source-default annotation area as X 30-70% and Y 10-90%, and it's strange to display this source default as different coordinates for different images... you get the idea. If we accommodate one thing, then the dissonance just seems to move somewhere else.
Overall, unless we come up with a very well thought out scheme, I might argue that the confusion about which way is X, which way is Y, which ways are rows/columns going, etc. would make turning on the EXIF orientation option more trouble than it's worth. But I could be missing something. I guess we'll see if people request this and give good reasons for it. Until then, it seems like low priority to me.
For future reference, here is a sample image with non-default EXIF (90 degree rotation): https://coralnet.ucsd.edu/image/12849/view/