Jpeg to Tiff - Bug?

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Jpeg to Tiff - Bug?

Post 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?
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Re: Jpeg to Tiff - Bug?

Post 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!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Jpeg to Tiff - Bug?

Post by fmw42 »

I am no expert on this, but it is possible that your libtiff needs to be configured for jpeg compression.
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Re: Jpeg to Tiff - Bug?

Post by FlashFan »

Yes I think that, too! But how can I do this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Jpeg to Tiff - Bug?

Post 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
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Re: Jpeg to Tiff - Bug?

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Jpeg to Tiff - Bug?

Post 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?
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Re: Jpeg to Tiff - Bug?

Post 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?
FlashFan
Posts: 13
Joined: 2011-01-05T03:41:09-07:00
Authentication code: 8675308

Re: Jpeg to Tiff - Bug?

Post by FlashFan »

Post Reply