I found error when calling ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE) for animated gif files. It seems that this problem occurs since version 1.7.3 (1.7.2 works). Test source:
int main(int argc, char* argv[])
{
ILuint imageId;
ILboolean success;
Otherwise, saving all images of the animation in separate png files (using ilActiveImage and ilSave(IL_PNG, ...)) works well but resulting files are bad. I found this problem only for optimized GIF files (if they use transparency to avoid duplication of similar part of the image).
When i've enough time, i will try to find more details (or fix) to help you debugging this problem.
Thanks,
Tom
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, I think I found the source of the problem. One was in ilConvertImage when it converts the palette. Another was in the GIF-loading code where the x and y offsets were not being properly applied for a frame. The version in CVS is able to load the Newton's cradle image just fine now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Devil team,
I found error when calling ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE) for animated gif files. It seems that this problem occurs since version 1.7.3 (1.7.2 works). Test source:
int main(int argc, char* argv[])
{
ILuint imageId;
ILboolean success;
if(argc < 2)
{
printf("no file\n");
return -1;
}
ilInit();
ilGenImages(1, &imageId);
ilBindImage(imageId);
success = ilLoadImage(argv[1]);
if(!success)
{
printf("error while openning file\n");
return -1;
}
success = ilConvertImage(IL_RGBA, IL_UNSIGNED_BYTE);
if(!success)
{
printf("error while converting image\n");
return -1;
}
...
Otherwise, saving all images of the animation in separate png files (using ilActiveImage and ilSave(IL_PNG, ...)) works well but resulting files are bad. I found this problem only for optimized GIF files (if they use transparency to avoid duplication of similar part of the image).
When i've enough time, i will try to find more details (or fix) to help you debugging this problem.
Thanks,
Tom
Do you have an example GIF that this fails on?
you can try with this one :
http://upload.wikimedia.org/wikipedia/commons/d/d3/Newtons_cradle_animation_book_2.gif
Okay, I think I found the source of the problem. One was in ilConvertImage when it converts the palette. Another was in the GIF-loading code where the x and y offsets were not being properly applied for a frame. The version in CVS is able to load the Newton's cradle image just fine now.
Good ! i will try it, thanks !