AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
February 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.02.15 14:36 "bug? JPEGQUALITY seems not to be read correctly", by <jcupitt@gmail.com>
2008.02.15 14:57 "Re: bug? JPEGQUALITY seems not to be read correctly", by Ed Grissom
2008.02.15 15:02 "Re: bug? JPEGQUALITY seems not to be read correctly", by <jcupitt@gmail.com>
2008.02.15 15:14 "Re: bug? JPEGQUALITY seems not to be read correctly", by Ed Grissom
2008.02.18 10:44 "Re: bug? JPEGQUALITY seems not to be read correctly", by Gerben Vos
2008.02.18 12:29 "Re: bug? JPEGQUALITY seems not to be read correctly", by <jcupitt@gmail.com>
2008.02.18 13:12 "Re: bug? JPEGQUALITY seems not to be read correctly", by Joris Van Damme
2008.02.18 14:23 "Re: bug? JPEGQUALITY seems not to be read correctly", by Joris Van Damme
2008.02.15 17:51 "Re: bug? JPEGQUALITY seems not to be read correctly", by Bob Friesenhahn

2008.02.18 12:29 "Re: bug? JPEGQUALITY seems not to be read correctly", by <jcupitt@gmail.com>

On 18/02/2008, Gerben Vos <Gerben@zylab.com> wrote:
> Some rather sophisticated code is available on the Internet to reconstruct
> the quality value from the tables in a JPEG.

Another approach might be to make TIFFTAG_JPEGQUALITY into a real tag.
This could be a simpler solution, and almost as good.

I noticed that TTN2 (the revised JPEG-in-tiff note) obsoleted tags 512
-- 521. Perhaps one of these could be reused? RESTART interval,
perhaps (it's a TIFF_SHORT):

#define TIFFTAG_JPEGRESTARTINTERVAL     515     /* !restart interval length
*/

So the procedure on new-style jpeg load and save might be:

save --
  note the value of TIFFTAG_JPEGQUALITY in tag 515
load --
  if present (and in the range 25 - 100, perhaps), use tag 515 to set the
  default value for TIFFTAG_JPEGQUALITY

Old-style jpeg-in-tiff would be unaltered. Of course Q settings are
not transferrable between jpeg implementations, but it sounds like the
Q guessers are not exact either. It seems to me that saving the Q
setting as a hint would not be any worse in practice than adding a Q
guesser and would be far simpler (just a few lines of code).

On the downside of course having tags that change meaning depending on
context is very, very ugly :-(

The same pseudo-tag problem will affect other compressors I suppose,
though JPEG is perhaps the most extreme one (huge changes in filesize
with different values).

John