Bug 404160

Summary: Krita creates a garbled image when converting from png or jpg to gif
Product: [Applications] krita Reporter: Antti Savolainen <antti.savo>
Component: File formatsAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, griffinvalley
Priority: NOR Keywords: triaged
Version: 4.1.7   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Antti Savolainen 2019-02-09 23:42:33 UTC
SUMMARY
When you want to convert a png or a jpg as a single image to gif, it creates a garbled image. Here is a link to test images and a .kra https://mega.nz/#F!UQRkRAyD!44LNVoMwoP7EuqY3D4Ybcg 

STEPS TO REPRODUCE
1. Open the linked .kra in krita
2. Save it as a gif

OBSERVED RESULT
Krita creates a garbled image, similar to what is seen in the link

EXPECTED RESULT
A normal still image in gif format

SOFTWARE/OS VERSIONS
Xubuntu 18.10
Version: krita 4.2.0-pre-alpha
Comment 1 wolthera 2019-03-06 09:43:48 UTC
Can reproduce with the nightly builds.
Comment 2 Dmitry Kazakov 2019-04-23 17:23:50 UTC
Git commit 4443c7065791754067fcda13d3c4db5d01e19c79 by Dmitry Kazakov.
Committed on 23/04/2019 at 17:18.
Pushed by dkazakov into branch 'master'.

Fix line length in GIF export

We cannot use QImage::bytesPerLine() for line length calculation
because it usually includes alignment bytes, which are not
recognized by giflib (obviously!).

M  +6    -1    plugins/impex/gif/qgiflibhandler.cpp

https://invent.kde.org/kde/krita/commit/4443c7065791754067fcda13d3c4db5d01e19c79