dynarithmic / twain_library

Dynarithmic TWAIN Library, Version 5.x
Apache License 2.0
60 stars 25 forks source link

How to set custom quality value when acquiring TIFF(jpeg) file #11

Closed LizhuWeng closed 4 years ago

LizhuWeng commented 4 years ago

Hi, I found it not work with custom quality setting by DTWAIN_SetJpegValues when acquiring file type with DTWAIN_TIFFJPEG.

LizhuWeng commented 4 years ago

It seems to be related to the FreeImage API flag setting, which found at CTIFFImageHandler::WriteGraphicFile in tiffun32.cpp

Any suggestion? Thanks.

dynarithmic commented 4 years ago

[Updated comment]

The DTWAIN_SetJpegValues will currently work only for actual JPEG files, not JPEG-In-TIFF files.

Since the plugin for TIFF is based on LibTIFF, I am not sure if the jpeg quality factor will work without extensive changes. See the discussion here on the TIFFTAG that is supposed to control the JPEG quality, but basically doesn't change the results. http://maptools-org.996276.n3.nabble.com/bug-JPEGQUALITY-seems-not-to-be-read-correctly-td1856.html

dynarithmic commented 4 years ago

I will be closing this issue, since the DTWAIN_SetJpegValues is designed to only work for JPEG files, not TIFF files.