I got new problem when I use WriteImage in MagickCore. I got a zero size JPEG image with no error.
The image_info setting is below:
ImageInfo *imgInfo;
imgInfo = AcquireImageInfo();
char * tmpStr;
sprintf(tmpStr,"%dx%d",width,height);
sprintf(imgInfo->filename,"%s",Path); //Path is the file path
imgInfo->size = tmpStr; //Does the size attribute mean total pixels?
imgInfo->compression = JPEGCompression;
imgInfo->colorspace = GRAYColorspace;
imgInfo->type = GrayscaleType;
And here is the output information of WriteImage:
id=ImageMagick version=1.0
class=DirectClass colors=0 matte=False
columns=480 rows=1779 depth=16
colorspace=Gray
compression=JPEG quality=0
units=PixelsPerInch
resolution=72x72
Is there any setting of image_info that I miss? Thanks you~!!
Zero size of JPEG image with WriteImage function
-
- Posts: 4
- Joined: 2011-04-28T00:17:33-07:00
- Authentication code: 8675308
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Zero size of JPEG image with WriteImage function
With MagickCore, no errors will ever be produced unless you report the exceptions that happen.
Not certain how that is done however, as I am generally modifying existing code (CLI interface or MagickCore functions) so it is done for me.
Not certain how that is done however, as I am generally modifying existing code (CLI interface or MagickCore functions) so it is done for me.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 4
- Joined: 2011-04-28T00:17:33-07:00
- Authentication code: 8675308
Re: Zero size of JPEG image with WriteImage function
I got the setting myself.
It should set the attribute "file" of imageInfo, instead of the attribute "filename" of imageInfo.
It should set the attribute "file" of imageInfo, instead of the attribute "filename" of imageInfo.