Bug 459840

Summary: Krita miss-aligns the layers when open multilayer tiff file
Product: [Applications] krita Reporter: LL <lingwangneuraleng>
Component: File formatsAssignee: amyspark <amy>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: 5.1.1   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: the original tiff
the expected result
the krita's wrong result

Description LL 2022-09-29 23:54:32 UTC
Created attachment 152510 [details]
the original tiff

SUMMARY
When open a tiff file contain layers that have different sizes, it miss-aligned the layers: it does not respect the layer position instead it always put layers from (0,0)


STEPS TO REPRODUCE
1.  open given tiff file in krita compare with the result from gimp or imagemagick (`convert test-size.tiff -flatten test-size.im.jpg`)

OBSERVED RESULT
The `test` text is misplaced.

EXPECTED RESULT
The `test` text should be placed as the test-size.im.jpg

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 LL 2022-09-29 23:55:37 UTC
Created attachment 152511 [details]
the expected result
Comment 2 LL 2022-09-29 23:56:48 UTC
Created attachment 152512 [details]
the krita's wrong result
Comment 3 Halla Rempt 2022-09-30 07:43:35 UTC
Amyspark, can you take a look?
Comment 4 amyspark 2022-10-01 00:09:48 UTC
Thanks for the sample. I had noticed that Krita did not support TIFF layer positioning, so it'll be an interesting fix to make.
Comment 5 amyspark 2022-10-04 00:56:41 UTC
Git commit 96ee473d4e0a5325a25caa3275773138cc464054 by L. E. Segovia.
Committed on 04/10/2022 at 00:55.
Pushed by lsegovia into branch 'master'.

TIFF: support sub IFD offsets

M  +15   -0    plugins/impex/tiff/kis_tiff_import.cc

https://invent.kde.org/graphics/krita/commit/96ee473d4e0a5325a25caa3275773138cc464054
Comment 6 amyspark 2022-10-04 00:57:15 UTC
Git commit e1d030ca8b638931a6f15ab5fcd92544e06c8d6a by L. E. Segovia.
Committed on 04/10/2022 at 00:56.
Pushed by lsegovia into branch 'krita/5.1'.

TIFF: support sub IFD offsets
(cherry picked from commit 96ee473d4e0a5325a25caa3275773138cc464054)

M  +15   -0    plugins/impex/tiff/kis_tiff_import.cc

https://invent.kde.org/graphics/krita/commit/e1d030ca8b638931a6f15ab5fcd92544e06c8d6a