Bug 488343

Summary: Batch Exporter python plugin does not respect trimming flag
Product: [Applications] krita Reporter: Ong Yong Xin <ongyongxin2020+kde>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: halla, nathan
Priority: NOR    
Version: 5.2.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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!