Summary: | Scale to New Size Doesn't Do Arithmetic Right | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Kenneth Evans <ken> |
Component: | Resize/Scale Image/Layer | Assignee: | Tiar <tamtamy.tymona> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | griffinvalley, tamtamy.tymona |
Priority: | NOR | ||
Version: | 4.1.5 | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | https://commits.kde.org/krita/03db690749bc2481396c510073a773acb6d3d60f | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Screenshot of Scale to New Size Dialog |
This is related to bug https://bugs.kde.org/show_bug.cgi?id=395267 but I am not 100% sure to say they are duplicates. I don't think it is a duplicate. The other issue is about print sizes and a possible limit for print only. This one has to do with imprecise calculations of image size. Git commit 03db690749bc2481396c510073a773acb6d3d60f by Wolthera van Hövell tot Westerflier, on behalf of Agata Cacko. Committed on 02/03/2019 at 11:06. Pushed by woltherav into branch 'master'. Fix the conversion errors in Scale to New Size dialog Summary: SpinBoxUnitManager used a function that not only converts units, but also rounds them (for the View), hence the conversion errors. This patch changes function to the precise one. Test Plan: Checking the Scale to New Size dialog to see whether the bug doesn't reproduce. Checking whether it doesn't break other scale/resize/offset/crop dialogs and every other place where the units are being used. Reviewers: #krita, rempt Reviewed By: #krita, rempt Tags: #krita Differential Revision: https://phabricator.kde.org/D19448 M +1 -1 libs/widgetutils/kis_spin_box_unit_manager.cpp https://commits.kde.org/krita/03db690749bc2481396c510073a773acb6d3d60f |
Created attachment 115838 [details] Screenshot of Scale to New Size Dialog I resized an image to 18" x 12" at 300 dpi. It didn't come out as 5400 x 3600, rather 5405 x 3602. I then tried sizing it to 5400 x 3600, and the size was 17.99" x 11.99". There seems to be an error somewhere. Even if done in float, it should have more precision than this. STEPS TO REPRODUCE 1. With an existing image, attempt to resize it to 18" x 12" @300 dpi. 2. Just look at the dialog. (You don't have to actually do it.) 3. OBSERVED RESULT 5405 x 3602 (or 17.99 x 11.99) EXPECTED RESULT 5400 x 3600 (or 18.00 x 12.00) Image attached of the setting 5400 x 3600 case.