Page 1 of 1

Jpeg to Tiff - Bug?

Posted: 2011-08-18T05:09:35-07:00
by FlashFan
Hi guys

I try to achieve a tiff with an embedded JPEG compressed image.

Using convert.exe the following works:

Code: Select all

convert 1.jpg -compress JPEG 1.tiff
When I try to do this usng Magick++ it doesn´t.

Code: Select all

Image img("1.jpg");
img.compressType(JPEGCompression);
img.write("1.tiff");
I get the following exception:
Unhandled exception at 0x74ecb727 in test.exe: Microsoft C++ exception: Magick::ErrorCoder at memory location 0x002ffc2c..

It points to Line 103 in file Thread.cpp

Is this a bug or is something wrong with my code?

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T07:46:42-07:00
by FlashFan
Hi guys!
I still couldn´t solve this problem. But I have some new info:

I catched the exception that was thrown and got it´s message text. It is:

Code: Select all

CompressionNotSupported `JPEG' @ error/tiff.c/WriteTIFFImage/2611
This exception is thrown at line 2611. It is thrown when the following condition is ture:

Code: Select all

(compress_tag != COMPRESSION_NONE) && (TIFFIsCODECConfigured(compress_tag) == 0)
Since compress_tag, I think, is set to JPEG-compression, it must be the secont thing that is false. That means that JPEG is simply not configured.
The question is why, and how I can fix it.

I´ve compiled ImageMagick by my own using the VisualStaticMT.sln that was created by the Visual Magick Project.
Then I included the headers and added the lib-files in my Project.


Please help me!

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T09:01:10-07:00
by fmw42
I am no expert on this, but it is possible that your libtiff needs to be configured for jpeg compression.

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T09:25:05-07:00
by FlashFan
Yes I think that, too! But how can I do this?

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T09:40:13-07:00
by fmw42
you will have to google for the libtiff specs and see what it says. there is probably some flag that needs to be set when you compile libtif

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T09:59:21-07:00
by FlashFan
Lines 53+54 of file tiffconf.h:

Code: Select all

/* Support JPEG compression (requires IJG JPEG library) */
#define JPEG_SUPPORT 1
So it seems to be enabled. But what can it be then?

Re: Jpeg to Tiff - Bug?

Posted: 2011-08-25T14:08:28-07:00
by fmw42
FlashFan wrote:Lines 53+54 of file tiffconf.h:

Code: Select all

/* Support JPEG compression (requires IJG JPEG library) */
#define JPEG_SUPPORT 1
So it seems to be enabled. But what can it be then?

Being set in libtiff does not mean that you have the IJG JPEG library installed. But note I have never dealt with this.

if you do

convert -list configure

Does the line starting with DELEGATES list IJG or something other than jpeg?

Re: Jpeg to Tiff - Bug?

Posted: 2011-09-12T06:00:18-07:00
by FlashFan
Does the line starting with DELEGATES list IJG or something other than jpeg?
No it doesn't. The output is:

Code: Select all

DELEGATES     bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
How can I install IJG?

Re: Jpeg to Tiff - Bug?

Posted: 2011-09-14T08:43:50-07:00
by FlashFan