tiff writeImages fail with JPEG compression converted to grayscale

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jorgjorg
Posts: 12
Joined: 2014-04-09T03:42:22-07:00
Authentication code: 6789

tiff writeImages fail with JPEG compression converted to grayscale

Post by jorgjorg »

Some color-images fail under Magick++ when trying to save them in TIF-format with JPEG compression and converted to grayscale
If I remove the img.type()-code, writeImages doesnt fail.

Error message:
Magick: IO error writing tag data. `TIFFWriteDirectoryTagData' @ error/tiff.c/TIFFErrors/553

ImageMagick 6.9.2-5 Q16 x86_64 2015-11-04
tifflib 4.0.6


Typical code:
std::vector<Magick::Image> imglist;
...reading source file and misc operations...
img.type( Magick::GrayscaleType );
img.resolutionUnits(Magick::PixelsPerInchResolution);
img.density(Magick::Geometry(200,200));
img.magick("TIF");
img.depth(8);
img.compressType(Magick::JPEGCompression);
img.scale..
..finished reading images...

Magick::Blob mblob_out;
writeImages(imglist.begin(), imglist.end(), &mblob_out);

The source file (a PDF) is located here: https://mail.netclient.no/file_link?id= ... 1894253351
Post Reply