Re: Trouble with using MagickGetSamplingFactors API

Bob Friesenhahn <[email protected]> Mon, 24 Jun 2013 09:05:44 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
On Thu, 20 Jun 2013, google wrote:

> Hi, all:
>         I have trouble with using MagickGetSamplingFactors API, I need your help.  I call the MagickGetSamplingFactors
> function  to get the image samplimg factor, but I always get NULL. How can I get the image samplimg factor? Can you give
> me a example. Thanks you a lot again.

This API retrieves values deposited into the ImageInfo structure, 
which is used while saving the image.  It won't have a value there 
unless you previously set it.

The JPEG reader does produce several key/value attributes based on 
the input file:

JPEG-Quality
JPEG-Colorspace
JPEG-Colorspace-Name
JPEG-Sampling-factors

The value you want is accessed via 'JPEG-Sampling-factors', if it is 
available.

You should be able to use MagickGetImageAttribute() with a name 
argument 'JPEG-Sampling-factors' to retrieve the value string.

Use 'gm identify -verbose file.jpg' to list the attribute information 
known for the file.

Other formats do not support sampling factors or use a different 
attribute name for it.

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

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

_______________________________________________
Graphicsmagick-apis mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-apis