Page 1 of 1

writeImages to blob bug?

Posted: 2008-09-09T10:10:14-07:00
by shr
Hi,
First of all I'm new to ImageMagick. so forgive me for my ignorance... :?
I've tried to read animated gif to a blob and recover it back to an image.
what I did is as follows:

Code: Select all

Blob blob;
vector<Image> loader,saver;
readImages(&loader,"input.gif");
cout<<loader.size(); //gives 16 (contains 16 frames)
writeImages(loader.begin(),loader.end(),&blob);
cout<<blob.length(); //gives 1086 (file size is 14Kb !!!)
readImages(&saver,blob);
cout<<saver.size(); //gives 1 (only 1 frame!!!)
writeImages(saver.begin(),saver.end(),"output.gif");
//and animation doesn't work (obviously)
I guess the problem is with the writeImages since the blob length is too short, and also because when I read the blob directly from the file (using fstream instead of using the readImages from file & the writeImages to blob) it keeps the animation.
so...
What should I do? is it a bug? have I missed something?

Thanks for any response!!!

Re: writeImages to blob bug?

Posted: 2008-09-09T11:10:27-07:00
by magick
We can reproduce the problem you reported and have a patch in the Subversion trunk within a day or two. Also look for the patch in the next point release. To fix your source distribution, change ImageToBlob() to ImagesToBlob() in Magick++/lib/Magick++/STL.h.

Re: writeImages to blob bug?

Posted: 2008-09-10T01:58:49-07:00
by shr
Thanks!