Bug 488343 - Batch Exporter python plugin does not respect trimming flag
Summary: Batch Exporter python plugin does not respect trimming flag
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.2.2
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-11 07:35 UTC by Ong Yong Xin
Modified: 2024-06-11 09:30 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 Ong Yong Xin 2024-06-11 07:35:36 UTC
SUMMARY
When exporting layers using the Batch Exporter, the trimming flag is ignored when the scaling flag is used with a partially transparent layer.

For example, a transparent layer of size 256x256px has a drawn square of size 64x64px.
Exporting the layer with flags `s=50 t=false` (50% scaling, no trimming) results in an image of size 32x32px, not 128x128px as expected.

STEPS TO REPRODUCE
1. Go to Settings -> Configure Krita -> Python Plugin Manager and enable Batch Exporter.
2. Restart Krita.
3. Create a new image of size 256x256px.
4. Create a new transparent paint layer, name it `Layer s=50 t=false p=.`, and delete the existing Background layer.
5. Draw a sqaure of size 64x64px.
6. Save the image as test.kra.
7. Export the layer by clicking 'All Layers' at the bottom right of the window.

OBSERVED RESULT
The PNG exported in the same directory as test.kra has a much smaller size than the set scaling.

EXPECTED RESULT
The PNG should be 128x128px in size.

SOFTWARE/OS VERSIONS
Windows: 11 Home (patch 22631.3593)

ADDITIONAL INFORMATION
After importing the original GDQuest Batch Exporter plugin, it seems that this issue was already fixed upstream in this commit: https://github.com/GDQuest/krita-batch-exporter/commit/5a46f6426cd22bf23ca94ece39097f3f947aa983

Since the plugin hasn't been updated in-tree since 22 December 2021 and the fix was committed on 6 March 2022, pulling in changes from upstream would be able to fix this bug.
Comment 1 Halla Rempt 2024-06-11 07:48:07 UTC
Since GDQuest isn't maintaining the plugin in Krita's tree anymore -- I haven't been in touch with them for ages. I've made a github issue to ask about the best way forward: https://github.com/GDQuest/krita-batch-exporter/issues/67
Comment 2 Nathan GDquest 2024-06-11 08:48:07 UTC
Hi there! We forgot to PR the latest patch to the plugin, sorry. I'll send the patch as soon as possible.
Comment 3 Ong Yong Xin 2024-06-11 09:06:05 UTC
Thanks for your quick reply!