Exif metadata rotation in jpg is ignored in image texture #92977

Open
opened 2021-11-10 00:30:48 +01:00 by Pascal · 18 comments

System Information
Operating system: Linux-5.8.18-050818-generic-x86_64-with-glibc2.31 64 Bits // Also tested same blender Version on Win 10
Graphics card: AMD Radeon RX 5700 XT (NAVI10, DRM 3.42.0, 5.8.18-050818-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.0.3

Blender Version
Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: blender/blender@a791bdabd0

Short description of error
Using a jpg in a shader as image texture, loaded from local drive, the metadata exif rotation of the image is ignored in rendering and even not shown in metadata information. Thus leading to wrong rotated orientation (compared to render result in Blender eevee and cycles) of the texture after exporting the object to gltf/glb.

Exact steps for others to reproduce the error
Uv unwrap a box (default secene) in blender, add a jpg with exif metadata rotation and export the box to gltf/glb. The textue has different rotation in the glb (i.e. beeing viewed in babylon.js sandbox or Verge 3D sneek peek) than it has in Blender. Looks like the WebGL engines use the metadata rotation and blender does not.
I would like to see a notice/warning/decide about the exif meta rotation (use?), when opening/referencing the jpg in Blender, like I get asked when opening the file in Gimp. That would help to keep the exported glb/gltf be consistent to the source blend file. {F11777818}Bildschirmfoto von 2021-11-10 00-20-53.png

**System Information** Operating system: Linux-5.8.18-050818-generic-x86_64-with-glibc2.31 64 Bits // Also tested same blender Version on Win 10 Graphics card: AMD Radeon RX 5700 XT (NAVI10, DRM 3.42.0, 5.8.18-050818-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.0.3 **Blender Version** Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: `blender/blender@a791bdabd0` **Short description of error** Using a jpg in a shader as image texture, loaded from local drive, the metadata exif rotation of the image is ignored in rendering and even not shown in metadata information. Thus leading to wrong rotated orientation (compared to render result in Blender eevee and cycles) of the texture after exporting the object to gltf/glb. **Exact steps for others to reproduce the error** Uv unwrap a box (default secene) in blender, add a jpg with exif metadata rotation and export the box to gltf/glb. The textue has different rotation in the glb (i.e. beeing viewed in babylon.js sandbox or Verge 3D sneek peek) than it has in Blender. Looks like the WebGL engines use the metadata rotation and blender does not. I would like to see a notice/warning/decide about the exif meta rotation (use?), when opening/referencing the jpg in Blender, like I get asked when opening the file in Gimp. That would help to keep the exported glb/gltf be consistent to the source blend file. {[F11777818](https://archive.blender.org/developer/F11777818/Bildschirmfoto_von_2021-11-09_02-16-09.png)}![Bildschirmfoto von 2021-11-10 00-20-53.png](https://archive.blender.org/developer/F11777828/Bildschirmfoto_von_2021-11-10_00-20-53.png)
Author

Added subscriber: @DeppDeeh

Added subscriber: @DeppDeeh
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Hi and thx for the report!

To speed up the process: please always include a simple example .blend file (including the packed texture) that demonstrates this issue.

Hi and thx for the report! To speed up the process: please always include a simple example .blend file (including the packed texture) that demonstrates this issue.
Member

Added subscriber: @JulienDuroure

Added subscriber: @JulienDuroure
Member

Think is linked to a similar ticket in gltf tracker: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1443

Think is linked to a similar ticket in gltf tracker: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1443
Author

Alright, thank you for the feedback.
Here are the files. The texture is packed into the blend-file.

Yes, the ticket in the gltf-tracker shows the same problem. I don't know if there is a general rule about when to ignore exif meta data in jpgs. But I think it would be very helpful to get internal cycles and eevee rendering and the exported gltf/glb-files lined up. At least a warning would help to avoid the mistake of setting up shaders with textures with ignored rotation and then, after export, the exif information is still present in the passed through jpg and the rotation is unexpetedly used in the WebGL engines.
Or maybe it is such a rare case that its not worth to think too much about it and just keep in mind that it might happen?

uv-box-test-2.blend

uv-box-test-2-blender-nativ-export.glb

uv-box-test-2-verge3d-export.glb

Alright, thank you for the feedback. Here are the files. The texture is packed into the blend-file. Yes, the ticket in the gltf-tracker shows the same problem. I don't know if there is a general rule about when to ignore exif meta data in jpgs. But I think it would be very helpful to get internal cycles and eevee rendering and the exported gltf/glb-files lined up. At least a warning would help to avoid the mistake of setting up shaders with textures with ignored rotation and then, after export, the exif information is still present in the passed through jpg and the rotation is unexpetedly used in the WebGL engines. Or maybe it is such a rare case that its not worth to think too much about it and just keep in mind that it might happen? [uv-box-test-2.blend](https://archive.blender.org/developer/F11789857/uv-box-test-2.blend) [uv-box-test-2-blender-nativ-export.glb](https://archive.blender.org/developer/F11789862/uv-box-test-2-blender-nativ-export.glb) [uv-box-test-2-verge3d-export.glb](https://archive.blender.org/developer/F11789867/uv-box-test-2-verge3d-export.glb)
Author

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

I think it is reasonable to ignore exif rotation throughout blender and not alter images in any way.
It is just not clear if the rotation is used anywhere down the road.
If this should get warnings in the UI, it is also not clear where to display these (on Nodes?, in the Image Editor? Everywhere?).
I'd like to get info from developers here to proceed.

One thing that does not hurt for sure is mentioning this in the manual
https://docs.blender.org/manual/en/dev/files/media/image_formats.html

I think it is reasonable to ignore exif rotation throughout blender and not alter images in any way. It is just not clear if the rotation is used anywhere down the road. If this should get warnings in the UI, it is also not clear where to display these (on Nodes?, in the Image Editor? Everywhere?). I'd like to get info from developers here to proceed. One thing that does not hurt for sure is mentioning this in the manual https://docs.blender.org/manual/en/dev/files/media/image_formats.html

Added subscriber: @brecht

Added subscriber: @brecht

I'll mark this as a known issue. It would be nice to do better here, but not sure I would consider this a bug.

There's probably not many other 3D apps or renderers taking into account this orientation for texture mapping, so even if we did use it, it's not obvious that improves interop in general.

I'll mark this as a known issue. It would be nice to do better here, but not sure I would consider this a bug. There's probably not many other 3D apps or renderers taking into account this orientation for texture mapping, so even if we did use it, it's not obvious that improves interop in general.
Author

I almost agree and it's not a big deal in most cases. But at least babylon.js and Verge3D do take the orientation into account. Looking at WebGL production pipelines, it would be smart to erase this possible mismatch. Since I know now that I have to check for possible exif rotation in textures (which is indeed a rare case), i.e. via Gimp or via preview in the WebGL-Engine, I am fine. So it is not a bug, just a possible workflow-barrier.
Could the Image viewer's side-tab, which shows metadata, also show these exif-metadata, if present? Right now in 2.93.5, it does not. Also the import dialog would be a possible location for an info about the presence of exif rotation meta information?
image-viewer.png

I almost agree and it's not a big deal in most cases. But at least babylon.js and Verge3D do take the orientation into account. Looking at WebGL production pipelines, it would be smart to erase this possible mismatch. Since I know now that I have to check for possible exif rotation in textures (which is indeed a rare case), i.e. via Gimp or via preview in the WebGL-Engine, I am fine. So it is not a bug, just a possible workflow-barrier. Could the Image viewer's side-tab, which shows metadata, also show these exif-metadata, if present? Right now in 2.93.5, it does not. Also the import dialog would be a possible location for an info about the presence of exif rotation meta information? ![image-viewer.png](https://archive.blender.org/developer/F11821651/image-viewer.png)

I think it would be good to solve or improve by showing metadata. But I don't consider it important enough to be a bug and prioritize solving it over other issues.

I think it would be good to solve or improve by showing metadata. But I don't consider it important enough to be a bug and prioritize solving it over other issues.

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Added subscriber: @AlexKowel

Added subscriber: @AlexKowel
Aaron Carlisle removed the
Module
Core
Module
Pipeline, Assets & IO
Module
Rendering & Cycles
labels 2023-02-08 04:53:41 +01:00

Most applications in Linux that read or edit bitmaps respect EXIF rotation. But Blender isn't respect it and this makes it difficult for workflow an user, forces you to look for software that will rotate the bitmap image without quality loss.

I would like to see in Blender the implementation of applying a EXIF-rotation when loading an image and an option in preferences.

Blender☹️ KDE Dolphin
Blender KDE Dolphine
Gwenview Nomacs
Gwenview Nomacs
Krita Inkscape
Krita Inkscape
Most applications in Linux that read or edit bitmaps respect EXIF rotation. But Blender isn't respect it and this makes it difficult for workflow an user, forces you to look for software that will rotate the bitmap image without quality loss. I would like to see in Blender the implementation of applying a EXIF-rotation when loading an image and an option in preferences. | | | | :------------------: | :-------------------------: | | **Blender** ↓ ☹️ | **KDE Dolphin** ↓ | | ![Blender](/attachments/f8c47ba9-8185-4bcd-ba59-eb230eefd2da) | ![KDE Dolphine](/attachments/e38eec9e-7d9e-4a19-8a46-25b9967d8fa8) | | | | | :--------------------: | :--------------------: | | **Gwenview** ↓ | **Nomacs** ↓ | | ![Gwenview](/attachments/fb5adf32-8288-4647-910f-1404f458f0e6) | ![Nomacs](/attachments/d3027485-59b3-4b7c-8331-9f52d11e930f) | | | | | :--------------------: | :--------------------: | | **Krita** ↓ | **Inkscape** ↓ | | ![Krita](/attachments/1103b140-4493-496c-83e5-b3afffd687b6) | ![Inkscape](/attachments/079b1885-654d-4789-bcc6-428213d86bd7) |

these cases might be rare, but they're a head scratcher that leads to having to google to find this thread. and it's such an insignificant thing to think, nay, know what Exif even is to the regular person, that i think blender could at least warn about this somewhere.

i reloaded blender multiple times, cleared orphan data, deleted materials, tried loading the rotated image (which i rotated in the default photos app of windows) in new blends, cleared windows' caches, opened the image in image editors (all had the correct image orientation, aka the rotation in the thumbnail i was seeing in the image's folder in windows), then more scratching my head on why, in blender's file viewer window, the orientation of the thumbnail image was "incorrect", googled the issue, googled how windows rotates images (thinking it could possibly be just "faking" the orientation and the rest of the apps just went along with it, except blender), to finally finding out about Exifs, reading up on Exifs, and then googling Exif + Blender to find this thread.

phew. that took 10 minutes for something that should not be a barrier to a simple image load into blender. a bit ocd, yes, but it would be nice not to be interrupted by some issue that goes all the way down to Exifs (whatever that was which i didn't know about or even thought i had to know to simply import an image into blender!)

hope this gets some attention for the sake of others.

these cases might be rare, but they're a head scratcher that leads to having to google to find this thread. and it's such an insignificant thing to think, nay, _know_ what Exif even is to the regular person, that i think blender could at least warn about this somewhere. i reloaded blender multiple times, cleared orphan data, deleted materials, tried loading the rotated image (which i rotated in the default photos app of windows) in new blends, cleared windows' caches, opened the image in image editors (all had the correct image orientation, aka the rotation in the thumbnail i was seeing in the image's folder in windows), then more scratching my head on why, in blender's file viewer window, the orientation of the thumbnail image was "incorrect", googled the issue, googled how windows rotates images (thinking it could possibly be just "faking" the orientation and the rest of the apps just went along with it, except blender), to finally finding out about Exifs, reading up on Exifs, and then googling Exif + Blender to find this thread. phew. that took 10 minutes for something that should not be a barrier to a simple image load into blender. a bit ocd, yes, but it would be nice not to be interrupted by some issue that goes all the way down to Exifs (whatever that was which i didn't know about or even thought i had to know to simply import an image into blender!) hope this gets some attention for the sake of others.
Aaron Carlisle added the
Module
Pipeline, Assets & IO
label 2023-08-13 15:20:46 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#92977
No description provided.