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 » 2013-09-09T11:33:54-07:00

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: 1563
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 » 2013-09-09T11:47:15-07:00

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 » 2013-09-09T11:56:18-07:00

Can you please post a sample code for that?

Thanks.

User avatar
dlemstra
Posts: 1563
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 » 2013-09-09T12:08:13-07:00

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 » 2013-09-10T11:26:23-07:00

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 » 2013-11-01T04:32:41-07:00

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

Post Reply