writeImages to blob bug?

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
shr
Posts: 7
Joined: 2008-09-09T09:45:33-07:00

writeImages to blob bug?

Post 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!!!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: writeImages to blob bug?

Post 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.
shr
Posts: 7
Joined: 2008-09-09T09:45:33-07:00

Re: writeImages to blob bug?

Post by shr »

Thanks!
Post Reply