How to write multi page image to multiple blobs?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
eadorean
Posts: 7
Joined: 2013-02-08T13:46:47-07:00
Authentication code: 6789

How to write multi page image to multiple blobs?

Post 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!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post by dlemstra »

You should iterate your vector and call the write method of Image.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
eadorean
Posts: 7
Joined: 2013-02-08T13:46:47-07:00
Authentication code: 6789

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

Post by eadorean »

Can you please post a sample code for that?

Thanks.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post 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
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
eadorean
Posts: 7
Joined: 2013-02-08T13:46:47-07:00
Authentication code: 6789

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

Post 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.
gabrielpasv
Posts: 3
Joined: 2013-11-01T04:30:23-07:00
Authentication code: 6789

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

Post by gabrielpasv »

I am also interested on this. Can anyone help ? Thanks
Post Reply