Page 1 of 1

How to write multi page image to multiple blobs?

Posted: 2013-09-09T11:33:54-07:00
by eadorean
Hello,

How could I write a multi page Magick++ Image to multiple blobs (each page to separate blob)?

I have the multi page image in a vector:

Code: Select all

vector<Image> imagevector;
Blob my_blob;
writeImages( imagevector.begin(), imagevector.end(), &my_blob );
and this writes all pages to 1 blob.

I want to write each page to separate blobs.

Thanks in advance!

Re: How to write multi page image to multiple blobs?

Posted: 2013-09-09T11:47:15-07:00
by dlemstra
You should iterate your vector and call the write method of Image.

Re: How to write multi page image to multiple blobs?

Posted: 2013-09-09T11:56:18-07:00
by eadorean
Can you please post a sample code for that?

Thanks.

Re: How to write multi page image to multiple blobs?

Posted: 2013-09-09T12:08:13-07:00
by dlemstra
You should be able to figure it out yourself with the following examples:

http://www.cplusplus.com/reference/vector/vector/begin/
http://www.imagemagick.org/Magick++/Image.html

Re: How to write multi page image to multiple blobs?

Posted: 2013-09-10T11:26:23-07:00
by eadorean
Thank you for taking the time to answer,

I tried:

Code: Select all

vector<Image> imageListmpp;  
    m = imageListmpp.size();
    vector<Blob> myblob;
  for (i = 0; i<m; i++)
  {
  imageListmpp[i].write(&myblob[i]);
  }
It compiles, but crashes on runtime. Unfortunately I do not have yet a debugger in place, so I do not know what is wrong.

Thanks.

Re: How to write multi page image to multiple blobs?

Posted: 2013-11-01T04:32:41-07:00
by gabrielpasv
I am also interested on this. Can anyone help ? Thanks