Commit 4443c706 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

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!).

BUG:404160
parent 033fd281
......@@ -302,8 +302,13 @@ bool QGIFLibHandler::write ( const QImage & image )
qWarning("EGifPutImageDesc returned error %d", gif->Error);
int lc = toWrite.height();
int llen = toWrite.bytesPerLine();
// NOTE: we suppose that the pixel size is exactly 1 byte, right now we
// cannot save anything else
int llen = toWrite.width();
// qDebug("will write %d lines, %d bytes each", lc, llen);
for (int l = 0; l < lc; ++l)
{
uchar* line = toWrite.scanLine(l);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment