Re: Specifying the file format when writing to a Blob
Bob Friesenhahn <[email protected]> Wed, 5 Sep 2012 20:27:43 -0500 (CDT)
| Newsgroups | gmane.comp.video.graphicsmagick.apis |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 5 Sep 2012, Marten Lehmann wrote: > > I can use writeImages() to either write to a filename like whatever.pdf > and then the SetImageInfo() function would extract the filetype pdf from > the extension and set image_info->magick to PDF and image_info->affirm > to MagickTrue. > > I can also use a filename like pdf:- and the full output would be > written as PDF to stdout. But as I'm using all this behind the pgmagick > library within Python, it is not that easy to fetch the output. > > So what I'm really missing is a way to specify a file format when using > writeImages() with a Blob target. With the output in the Blob, I could > really do everything in-memory, without workarounds like fetching stdout > or using temporary files which will be deleted after reading. > > Any ideas? Anything existing, that I have overseen? You have not overseen anything. This is a design defect in the API. I believe that an effective workaround would be to use the Magick::Image::magick() (i.e. image.magick()) method to set the format in the first frame of the vector/list. This should work because the writer uses the current image set format from the first image in the list when writing. I am adding this to the top of my TODO list and perhaps it will be fixed in this next release. Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/