Skip to content
Snippets Groups Projects
Commit 9b0af8d4 authored by Manuel Günther's avatar Manuel Günther Committed by André Anjos
Browse files

Switched back to reading first image; later images might be incomplete

parent 048296be
No related branches found
No related tags found
1 merge request!24Resolve "GIF loading seems to be completely broken"
Pipeline #
...@@ -441,13 +441,23 @@ static void im_load_color(boost::shared_ptr<GifFileType> in_file, bob::io::base: ...@@ -441,13 +441,23 @@ static void im_load_color(boost::shared_ptr<GifFileType> in_file, bob::io::base:
// Need to perform 4 passes on the images: // Need to perform 4 passes on the images:
for(int i=0; i<4; ++i) for(int i=0; i<4; ++i)
for(int j=row+InterlacedOffset[i]; j<row+height; j+=InterlacedJumps[i]) { for(int j=row+InterlacedOffset[i]; j<row+height; j+=InterlacedJumps[i]) {
error = DGifGetLine(in_file.get(), &screen_buffer[j][col], width); if (image_found)
// image buffer already filled; read in into junk buffer
error = DGifGetLine(in_file.get(), &temp_buffer[col], width);
else
// read into image buffer
error = DGifGetLine(in_file.get(), &screen_buffer[j][col], width);
if(error == GIF_ERROR) GifErrorHandler("DGifGetLine", in_file->Error); if(error == GIF_ERROR) GifErrorHandler("DGifGetLine", in_file->Error);
} }
} }
else { else {
for(int i=0; i<height; ++i) { for(int i=0; i<height; ++i) {
error = DGifGetLine(in_file.get(), &screen_buffer[row++][col], width); if (image_found)
// image buffer already filled; read in into junk buffer
error = DGifGetLine(in_file.get(), &temp_buffer[col], width);
else
// read into image buffer
error = DGifGetLine(in_file.get(), &screen_buffer[row++][col], width);
if(error == GIF_ERROR) GifErrorHandler("DGifGetLine", in_file->Error); if(error == GIF_ERROR) GifErrorHandler("DGifGetLine", in_file->Error);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment