I'm using a simple QImage program to look at frames from GIF animations. Occasionally the output image is corrupted, with black areas appearing over it. I have tried doing a simple export of the frames to files, in JPG, PNG, and GIF format and the results are the same. I've also verified the black areas are not transparency (although I've no idea how to set this in Qt if that were the case).
This is the relevant code:
So I'm wondering if this is a known issue or if anyone else has encountered this? Or perhaps there are some changes required for certain colourspaces or something else I am not considering.QImage* image = new QImage();
QImageReader* reader = new QImageReader(gif);
reader->read(image);
for(int index=0;index<=reader->imageCount();index++)
{
reader->jumpToNextImage();
reader->read(image);
QString frameName = dir + '/' + QString("out%1.jpg").arg(index,5,10,QChar('0'));
image->save(frameName,"JPEG",100);
}
Bookmarks