Bug 435038 - Krita document DPI affects Reference Images: saved image is loaded differently on load.
Summary: Krita document DPI affects Reference Images: saved image is loaded differentl...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Reference Images (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-27 21:38 UTC by epicwrathssin
Modified: 2023-06-23 22:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description epicwrathssin 2021-03-27 21:38:57 UTC
SUMMARY
The DPI on the Krita document, set at creation, affects how Reference Images are displayed when the document is saved and loaded.  It appears properly on save, but on load, the results are unexpected, depending on the DPI. 

STEPS TO REPRODUCE PROBLEM
1. Create a 1920x1080 canvas with DPI of 1
2. Insert a Reference Image.  I used a large resolution image, from a phone camera (about 4000x4000)
3. Resize reference to desired size (a small portion of the canvas).
4. Save image.
5. Load image.

STEPS TO REPRODUCE WORKING NORMALLY
1. Create a 1920x1080 canvas with DPI of 300.
All other steps are above.

OBSERVED RESULT
The Document with the Reference Image is not displayed the same way as when the Document was saved.  I'm not sure how to describe it, but the Document size is hundreds of times wider than at save time.

It appears that if the Reference Image is resized and saved after this happens, it loads how it was saved.  The Document dimensions are still broken at this point.

EXPECTED RESULT
The Document loads just like when it was saved.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.4.0-70-generic 5.18.5
(available in About System)
KDE Plasma Version: 5.18.5 
KDE Frameworks Version: 5.56.0
Qt Version: Compiled&Loaded 5.12.8

ADDITIONAL INFORMATION
Same behavior with Krita 4.4.3 App Image, and 5.0.0-prealpha git-fe3d2f4
Comment 1 Ahab Greybeard 2021-04-01 09:56:57 UTC
I can reproduce this issue for the 4.4.3 appimage and the Mar 30 5.0.0-prealpha (git 783r86c) appimage.

It only happens if the created document has a dpi of 1.
The 5.0.0-prealpha has the ability to set fractional dpi values and it does not happen for a dpi value of 1.1 or higher, only for 1.0.

The reference image appears at a very large size and with a very large offset from the image position.

Examination of the .kra file maindoc.xml does not show any significant difference between reference inage size and transform values (for dpi = 1.1 vs dpi = 1.0) that could account for this.

Setting to Confirmed
Comment 2 Freya Lupen 2023-06-23 22:24:02 UTC
I can reproduce this with a 1 dpi document on 5.0.6, but not with loading the same document on 5.1.0 and later (5.2.0-prealpha-5d138703f8), so marking as Fixed.