| Summary: | [File Layers] Wrong (up)scaling of File layer when this one has transparency around it. | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | David REVOY <info> |
| Component: | Layer Stack | Assignee: | Dmitry Kazakov <dimula73> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | dimula73, freebox64, halla |
| Priority: | NOR | ||
| Version First Reported In: | git master (please specify the git hash!) | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/krita/commit/ab91d8ee40021a5ce35d4da40191a545996f281e | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: | Video | ||
|
Description
David REVOY
2018-07-03 15:58:26 UTC
Hm, here it does scale to 256x256, but it is placed with the top-level corner in the center of the image after setting the scale to image size option. Here I have this result after scaling: https://www.peppercarrot.com/extras/temp/2018-07-11_screenshot_094840_net.jpg If I move it/recenter it: https://www.peppercarrot.com/extras/temp/2018-07-11_screenshot_094945_net.jpg It looks like Krita autocrop the transparent pixels around the original 128x128 and then upscale the obtained new geometry (the central part) to 256x256, and also move a top-left corner to centerX and centerY of the canvas. Expected would be: https://www.peppercarrot.com/extras/temp/2018-07-11_screenshot_095056_net.jpg ...to respect the transparent padding around the original 128x128 picture. Created attachment 114823 [details]
Video
Hi, in my case, I'm getting the same behaviour as David (see video - Krita Appimage 4.2.0-pre-alpha (git 65a1598) - Ubuntu 14.04, Unity).
Git commit 9f4810685ded1d9ee1ac0b654416d7c61b56c42f by Dmitry Kazakov. Committed on 13/08/2020 at 13:56. Pushed by dkazakov into branch 'krita/4.3'. Fix scaling of file layers with transparent background For upscaling/downscaling the image we should use its physical size saved in the original file, not just the bounding rect calculated with exactBounds(). This patch may change the look of existing .kra files, but we can consider this case inexistent, because the offset of transparent file layers has always been calculated incorrectly. I don't think anyone could use the feature for transparent layers because of that. CC:kimageshop@kde.org M +9 -7 libs/ui/kis_file_layer.cpp M +1 -1 libs/ui/kis_file_layer.h M +4 -1 libs/ui/kis_safe_document_loader.cpp M +1 -1 libs/ui/kis_safe_document_loader.h https://invent.kde.org/graphics/krita/commit/9f4810685ded1d9ee1ac0b654416d7c61b56c42f Git commit ab91d8ee40021a5ce35d4da40191a545996f281e by Dmitry Kazakov. Committed on 13/08/2020 at 13:59. Pushed by dkazakov into branch 'master'. Fix scaling of file layers with transparent background For upscaling/downscaling the image we should use its physical size saved in the original file, not just the bounding rect calculated with exactBounds(). This patch may change the look of existing .kra files, but we can consider this case inexistent, because the offset of transparent file layers has always been calculated incorrectly. I don't think anyone could use the feature for transparent layers because of that. CC:kimageshop@kde.org M +9 -7 libs/ui/kis_file_layer.cpp M +1 -1 libs/ui/kis_file_layer.h M +4 -1 libs/ui/kis_safe_document_loader.cpp M +1 -1 libs/ui/kis_safe_document_loader.h https://invent.kde.org/graphics/krita/commit/ab91d8ee40021a5ce35d4da40191a545996f281e |