Re: Writing image to blob PNG vs TIFF

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
On Mon, 18 Dec 2017, Robert H. Olsen wrote:
>
> I think I'm probably misunderstanding what you mean by "multiple image 
> frames" though?

Probably I provided an answer for a different question. :-)

The TIFF format supports multiple frames per file and PNG does not. 
But that is apparently not what you are doing.

I don't know what your GetPBlob() function does.

I would expect that there is a new memory allocation in the Blob 
object for each image write and the existing allocation is freed. 
The Blob object can support memory allocated via malloc() or C++ 
'new'.  The C code can only allocate memory via malloc().  Each image 
written might require a different size allocation.

I would hope that the Blob does not need to be empty in order to be 
written on.  I would also hope that there is nothing stateful about 
writing TIFF files so it only works once.

> I'm only interested in dealing with a single image at a time - not, for 
> example, making a multiple-image TIFF.  I want to capture an image, process 
> it, package it, send it out over the network and then wait for another.  And 
> this works fine if I tell Image.write that it's a PNG.  Is there some way of 
> saying "this is a new, distinct image" when writing TIFF to a blob, other 
> than changing its size? Would toggling between two different pBlob memory 
> locations trick it?

I am not sure what the problem is and do not have time to try to 
replicate the issue.  It is useful to master the tracing.  It appears 
that Magick++ does not currently offer functions to control the 
tracing.  The tracing can be controlled via the MAGICK_DEBUG 
environment variable.  The value string useful for MAGICK_DEBUG is the 
same as the command-line -debug option:

       -debug <events>
               enable debug printout

               The events parameter specifies which events are to be
               logged.  It can be either None, All, or a comma-sepa‐
               rated list consisting of one or more of the following
               domains: Annotate,  Blob,  Cache,  Coder,  Configure,
               Deprecate, Error, Exception, Locale, Render,Resource,
               TemporaryFile, Transform, Warning, X11, or User.  For
               example, to log cache and blob events, use

                   gm convert -debug "Cache,Blob" rose: rose.png

You could use "Blob,Coder,Exception" to learn quite a lot about what 
is going on.  The word "All" also works in order to enable everything.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Graphicsmagick-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.