Bug 457447

Summary: Measure Tool physical distance scaling not updated after document dpi change - needs file reopening
Product: [Applications] krita Reporter: Ahab Greybeard <ahab.greybeard>
Component: Resize/Scale Image/LayerAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: intuos5, opensource, tamtamy.tymona
Priority: NOR Keywords: triaged
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Debian stable   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ahab Greybeard 2022-08-03 13:00:03 UTC
SUMMARY
The Measure Tool physical distance measurement depends on the dpi/ppi resolution of the document.
When a .kra file is first opened, this measurement is correct.
If the dpi of the document is changed, the physical distance measurement is still based on the original resolution and so it is wrong.

You have to Save then Close then re-Open the .kra file to update the resolution used by the Measure Tool.

This was tested with the 5.2.0-prealpha (git ad6cd3b18d) appimage on Debian 10.

STEPS TO REPRODUCE
See Summary

OBSERVED RESULT
See Summary

EXPECTED RESULT
The Measure Tool should use the new dpi/ppi value as soon as it is changed.


SOFTWARE/OS VERSIONS
Krita
 Version: 5.2.0-prealpha (git ad6cd3b)
 Hidpi: false

Qt
  Version (compiled): 5.12.12
  Version (loaded): 5.12.12

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.19.0-20-amd64
  Pretty Productname: Debian GNU/Linux 10 (buster)
  Product Type: debian
  Product Version: 10
  Desktop: MATE
Comment 1 Hologram 2022-09-23 12:00:16 UTC
Indeed, when I change the DPI of the image with Image > Scale Image to New Size, the measure tool doesn't update physical, metric sizes.
Comment 2 Louis Pearson 2022-12-02 20:07:21 UTC
I am attempting to fix this. I have reproduced the bug, and found a new detail: If the resize occurs before the measurement tool is used, the measurement will be correct. If the resize is undone, the measuring the initial size will be incorrect.

I'm new to krita development so I don't know for sure, but it seems likely that the measurement tool is caching the resolution at it's creation time.