Bug 442127

Summary: File Layers do not scale properly using "Adapt to Image Resolution (ppi)"
Product: [Applications] krita Reporter: SirPigeonz <GBirdboy>
Component: Layer StackAssignee: egorefimov24
Status: RESOLVED FIXED    
Severity: normal CC: egorefimov24, halla, wstephenson
Priority: NOR Keywords: triaged
Version: 5.0.0-beta1   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: test project
test project NEW

Description SirPigeonz 2021-09-07 13:29:01 UTC
Created attachment 141361 [details]
test project

SUMMARY

I plan to use Krita for comic, so I was interested in testing File Layers and how well they handle rescaling of sub-files (comic panels from sketch to final in hi-res).
I tried to incorporate adaptive ppi scaling in File Layers, but they produced weird results.
After some tests, I figured out that the only type of sub-file that is scaled properly is 72 dpi file.
Any other dpi will produce a File Layer that is either too small or usually too big.
I attached some test project.


STEPS TO REPRODUCE
1. Create Main File A4 300dpi
2. Create Sub File 1, select A4 300dpi and switch from pixels to inches, then switch 300dpi to 100dpi.
3. Create Sub File 2, the same as Sub File 1 but dpi should be 72dpi
4. Add each Sub File as a File Layer with Scaling Option set to "Adapt to Image Resolution (ppi)"

OBSERVED RESULT
File Layer with original 100dpi is too big.
File Layer with original 72dpi is the same size as Main File.


EXPECTED RESULT
Both File Layers should be the same size.

Ideally when the Sub File is the same DPI as the Main File, the scaling in File Layer should be skipped.


SOFTWARE/OS VERSIONS
Windows: 10
Qt: 5.12.11

ADDITIONAL INFORMATION
I tried to paste system information, but the window crashed Krita I will fill another bug report for it.
Comment 1 Halla Rempt 2021-09-08 09:08:54 UTC
I cannot open the attached zip file:

 Archive:  bug_dpi_file_layer_scaling.zip
   skipping: bug_dpi_file_layer_scaling/main_200dpi.kra  need PK compat. v6.3 (can do v4.6)
   skipping: bug_dpi_file_layer_scaling/sub/sub1_100dpi.kra  need PK compat. v6.3 (can do v4.6)
   skipping: bug_dpi_file_layer_scaling/sub/sub2_72dpi.kra  need PK compat. v6.3 (can do v4.6)
Comment 2 SirPigeonz 2021-09-08 14:56:18 UTC
Created attachment 141394 [details]
test project NEW
Comment 3 SirPigeonz 2021-09-08 14:56:54 UTC
(In reply to Halla Rempt from comment #1)
> I cannot open the attached zip file:
> 
>  Archive:  bug_dpi_file_layer_scaling.zip
>    skipping: bug_dpi_file_layer_scaling/main_200dpi.kra  need PK compat.
> v6.3 (can do v4.6)
>    skipping: bug_dpi_file_layer_scaling/sub/sub1_100dpi.kra  need PK compat.
> v6.3 (can do v4.6)
>    skipping: bug_dpi_file_layer_scaling/sub/sub2_72dpi.kra  need PK compat.
> v6.3 (can do v4.6)

Can you check "test project NEW"?
Comment 4 Bug Janitor Service 2021-09-09 04:36:17 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 5 Will Stephenson 2021-12-16 09:38:29 UTC
I could open test project NEW with win10 file explorer
Reproduced with 5.0.0beta5 0e4b844
Comment 6 egorefimov24 2022-12-24 09:42:15 UTC
Fixed in 

commit 161c985969adff63a141e924125c5805393dcf04 
Author: Egor Efimov <egorefimov24@gmail.com>
Date:   Thu Dec 22 16:10:38 2022 +0300

    Fix bug 442127. Set KisImage resolution on FileLayer image loading