Bug 425832 - TIFFTAG_ORIENTATION ignored on import
Summary: TIFFTAG_ORIENTATION ignored on import
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.3.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-26 12:59 UTC by FalCT60
Modified: 2021-12-05 14:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description FalCT60 2020-08-26 12:59:53 UTC
SUMMARY
Krita 4.3.0 on Ubuntu 20.04 LTS.
Importing TIFFs with orientation information embedded are displayed upside-down.

STEPS TO REPRODUCE
1. load the file https://we.tl/t-RTWl67rF4I
2. the 2 brightest stars should be resp. in the top left and right corners
3. 

OBSERVED RESULT
The stars are in the bottom corners instead.

EXPECTED RESULT
Correct display, top up and bottom down.

SOFTWARE/OS VERSIONS
Linux: Ubuntu 20.04 LTS
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
As the picture exceeds the size limit, and I did not want to alter it with other sofware, I used an hosting server.
TIFF tag details : https://awaresystems.be/imaging/tiff/tifftags/orientation.html
ImageMagick behavees the same way.
Comment 1 Halla Rempt 2020-08-26 13:05:55 UTC
I wonder whether this is a relatively new tag, or a tag that's not part of the base standard -- gwenview cannot show the image at all, imagemagick shows it in the same orientation as Krita, Gimp 2.10 does see the rotation data, but says it's part of the Exif metadata -- and says "Calling error for procedure gimp-item-transform-flip-simple", but rotates it all the same.
Comment 2 Bug Janitor Service 2021-08-12 01:12:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/997
Comment 3 Halla Rempt 2021-08-16 08:56:14 UTC
Git commit ebf722629bc6c95e44297d527d3d04ee0da6cad2 by Halla Rempt, on behalf of L. E. Segovia.
Committed on 16/08/2021 at 08:55.
Pushed by rempt into branch 'master'.

TIFF & JPEG: handle Exif orientation

TIFF never handled it at all; JPEG has two cases that are broken:
- ORIENTATION_TOPRIGHT
- ORIENTATION_BOTLEFT

These were corrected and checked against Windows and macOS's CGImage
documentation.

M  +2    -2    plugins/impex/jpeg/kis_jpeg_converter.cc
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_1.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_2.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_3.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_4.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_5.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_6.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_7.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_8.jpg.png
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_1.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_2.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_3.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_4.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_5.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_6.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_7.jpg
A  +-    --    plugins/impex/jpeg/tests/data/sources/transform_rotate_test_8.jpg
M  +39   -0    plugins/impex/tiff/kis_tiff_converter.cc
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_1.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_2.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_3.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_4.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_5.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_6.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_7.tif.png
A  +-    --    plugins/impex/tiff/tests/data/results/transform_rotate_test_8.tif.png
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_1.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_2.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_3.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_4.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_5.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_6.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_7.tif
A  +-    --    plugins/impex/tiff/tests/data/sources/transform_rotate_test_8.tif

https://invent.kde.org/graphics/krita/commit/ebf722629bc6c95e44297d527d3d04ee0da6cad2
Comment 4 amyspark 2021-12-05 14:20:23 UTC
Git commit 692c1c1d9f7c447a727ddb708905b16bb1116952 by L. E. Segovia.
Committed on 05/12/2021 at 14:18.
Pushed by lsegovia into branch 'master'.

Fix kis_jpeg_test sources for libjpeg v8

A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_1.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_2.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_3.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_4.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_5.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_6.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_7.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_8.jpg_80.png

https://invent.kde.org/graphics/krita/commit/692c1c1d9f7c447a727ddb708905b16bb1116952
Comment 5 amyspark 2021-12-05 14:21:15 UTC
Git commit 7f6def0955ff38bd279a310498042d7f3a517f3f by L. E. Segovia.
Committed on 05/12/2021 at 14:21.
Pushed by lsegovia into branch 'krita/5.0'.

Fix kis_jpeg_test sources for libjpeg v8
(cherry picked from commit 692c1c1d9f7c447a727ddb708905b16bb1116952)

A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_1.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_2.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_3.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_4.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_5.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_6.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_7.jpg_80.png
A  +-    --    plugins/impex/jpeg/tests/data/results/transform_rotate_test_8.jpg_80.png

https://invent.kde.org/graphics/krita/commit/7f6def0955ff38bd279a310498042d7f3a517f3f