TIF/JPeg reading with LeadTools

Discussions about image processing and document imaging.
Post Reply
mvanrijnen
Posts: 10
Joined: Mon Apr 15, 2013 1:27 pm

TIF/JPeg reading with LeadTools

Post by mvanrijnen » Wed Oct 02, 2013 1:50 pm

Hi,

When we create TIFF/JPG files with GDPicture, we have troubles reading them with another application which uses leadtools.
Somehow it's impossible to read these files ?

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: TIF/JPeg reading with LeadTools

Post by SamiKharma » Thu Oct 03, 2013 1:24 pm

Hi,

Are those files being read by windows? If so, I would contact Leadtools.
If they are not read by windows, please provide a sample.

Best,
Sami

mvanrijnen
Posts: 10
Joined: Mon Apr 15, 2013 1:27 pm

Re: TIF/JPeg reading with LeadTools

Post by mvanrijnen » Thu Oct 03, 2013 1:39 pm

Files are displayed NOT displayed with Windows XP.
With Windows 7 they are displayed.
Sample i have to prepare, coming tomorrow.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TIF/JPeg reading with LeadTools

Post by Loïc » Fri Oct 04, 2013 12:07 pm

Hello,

My bet is the TIFF decoder of leadtools supports only 24-bit JPEG compressed page in TIFF with YCBCR color space while RGB can be used...
The next minor version of GdPicture will produce TIFF page in YCBCR color space when JPEG compression will be used. This should hep to maximize compatibility with the leadtools codec and also reduces the produced page size.

That said, let me suggest to use GdPicture instead of Leadtools :wink:

With best regards,

Loïc

mvanrijnen
Posts: 10
Joined: Mon Apr 15, 2013 1:27 pm

Re: TIF/JPeg reading with LeadTools

Post by mvanrijnen » Fri Oct 04, 2013 12:43 pm

We use LT in a product where we just simply can change to gdpicture (various reasons).
Thats the reason, we have to have this backwards compatibility.

LTSupport
Posts: 1
Joined: Thu Nov 21, 2013 3:45 pm

Re: TIF/JPeg reading with LeadTools

Post by LTSupport » Thu Nov 21, 2013 3:51 pm

My name is Mohamed and I am a LEADTOOLS support agent.
Like SamiKharma suggested, I recommend contacting us by sending a message to support@leadtools.com. We usually respond the same day and almost never exceed 2 business days.
If the JPEG that doesn't load with our toolkit appears to be a valid image file, please include it in the email and we will check it.
Our library support almost all JPEG and TIFF variations, including some sub-types not supported by the vast majority of other viewers, such as lossless JPEG or TIFF with JPEG2000 or JBIG compression.
If your file happens to be unsupported at the moment, we would gladly submit a feature request to our engineers.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TIF/JPeg reading with LeadTools

Post by Loïc » Thu Nov 21, 2013 4:59 pm

Hello Mohamed,

Thank you for promoting LeadTools here...

You can find 2 attached TIFF/JPEG images (gdpicture1.tif and gdpicture2.tif). My bet is one of the two is not correctly decoded by LeadTools. I've wrote a clue in the userComment tag to help your engineers ;)

Original file (PNG)
original.png
TIFF/JPEG
gdpicture1.tif
gdpicture1.tif (72.22 KiB) Viewed 10270 times
gdpicture2.tif
gdpicture2.tif (67.11 KiB) Viewed 10270 times
With best regards,

Loïc

mvanrijnen
Posts: 10
Joined: Mon Apr 15, 2013 1:27 pm

Re: TIF/JPeg reading with LeadTools

Post by mvanrijnen » Thu Nov 21, 2013 6:07 pm

:)

Cosmin
Posts: 1
Joined: Fri Feb 08, 2013 11:36 am

Re: TIF/JPeg reading with LeadTools

Post by Cosmin » Thu Nov 21, 2013 8:47 pm

love-gd.jpg

gbruninx
Posts: 3
Joined: Tue Feb 10, 2015 5:25 pm

Re: TIF/JPeg reading with LeadTools

Post by gbruninx » Tue Feb 10, 2015 5:40 pm

Hello Loïc,

you are correct that one of the tiffs (gdpicture1.tif) is not 'readable' with leadtools. Is it also possible to have an output from gdpicture like in gdpicture2.tif (if so, how) or is that one incorrect (could you tell us why)?

[I'm working for the same company as mvanrijnen.]

gbruninx
Posts: 3
Joined: Tue Feb 10, 2015 5:25 pm

Re: TIF/JPeg reading with LeadTools

Post by gbruninx » Wed Feb 11, 2015 11:08 am

Hello Loïc,

Is it correct to think that this snippet below from the 10.1 release notes , has a correlation with this topic. If so, could you provide me some extra pointers (or an example) to what we need to do to change that tag.
Added support to determine if TIFF/JPEG codec must produce image including quantization tables and or Huffman tables (by altering the JpegTablesMode exif tag).

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TIF/JPeg reading with LeadTools

Post by Loïc » Wed Feb 11, 2015 2:36 pm

Hi,

You can try a workaround: Before producing the file you can use this line of code.

Code: Select all

gdPictureImaging.TagSetValueString(ImageID, Tags.TagJPEGTablesMode, TagType.TagTypeByte, "1");
That said, it would be great if you could check with Leadtools support issues about they SDK. As mohamed said: "We usually respond the same day and almost never exceed 2 business days".

With best regards,

Loïc

gbruninx
Posts: 3
Joined: Tue Feb 10, 2015 5:25 pm

Re: TIF/JPeg reading with LeadTools

Post by gbruninx » Wed Feb 11, 2015 3:50 pm

Thanks for that tip. It becomes readable with jpegtablesmode 2 and 3.
What is the risk/downside in using that tag? Will there be problems with that tiff? Is that tiff "incorrect"?


JPEGTABLESMODE=0/1/2/3: (From GDAL 2.0) Configure how and where JPEG quantization and Huffman tables are written in the TIFF JpegTables tag and strip/tile. Default to 1.

0: JpegTables is not written. Each strip/tile contains its own quantization tables and use optimized Huffman coding.
1: JpegTables is written with only the quantization tables. Each strip/tile refers to those quantized tables and use optimized Huffman coding. This is generally the optimal choice for smallest file size, and consequently is the default.
2: JpegTables is written with only the default Huffman tables. Each strip/tile refers to those Huffman tables (thus no optimized Huffman coding) and contains its own quantization tables (identical). This option has no anticipated practical value.
3: JpegTables is written with the quantization and default Huffman tables. Each strip/tile refers to those tables (thus no optimized Huffman coding). This option could perhaps with some data be more efficient than 1, but this should only occur in rare circumstances.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: TIF/JPeg reading with LeadTools

Post by Loïc » Wed Feb 11, 2015 3:58 pm

I don't see any risk. All options produce valid documents.
GdPicture use 1 as default.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests