Received: from [207.113.13.68] by phillip.cerious.com (NTMail 3.03.0017/7.aaxh) with ESMTP id pcrews for <pcrews@cerious.com>; Thu, 10 Dec 1998 11:03:05 -0500
Received: from localhost (bin@localhost)
	by gate7.olympiakos.com (8.8.7/8.8.7) with SMTP id KAA26315;
	Thu, 10 Dec 1998 10:48:10 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Thu, 10 Dec 1998 10:45:02 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.8.7/8.8.7) id KAA26225
	for tiff-outgoing; Thu, 10 Dec 1998 10:44:59 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from sgi.sgi.com (SGI.COM [192.48.153.1])
	by gate7.olympiakos.com (8.8.7/8.8.7) with ESMTP id KAA26213
	for <tiff@olympiakos.com>; Thu, 10 Dec 1998 10:44:49 -0500
Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) 
	by sgi.sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam:
       SGI does not authorize the use of its proprietary
       systems or networks for unsolicited or bulk email
       from the Internet.) 
	via ESMTP id HAA00165
	for <tiff@sgi.com>; Thu, 10 Dec 1998 07:44:44 -0800 (PST)
	mail_from (tgl@sss.pgh.pa.us)
Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1])
	by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA12529;
	Thu, 10 Dec 1998 10:29:16 -0500 (EST)
To: tiff@sgi.com, jpeg-l@ijg.org
cc: "Thies C. Arntzen" <thies@digicol.de>
Subject: Re: OJPEG_SUPPORT in 3.4b37 
In-reply-to: Your message of Thu, 10 Dec 1998 08:10:57 -0500 
             <v03110703b2957819c2ad@[198.206.216.15]> 
Date: Thu, 10 Dec 1998 10:29:16 -0500
Message-ID: <12527.913303756@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
Sender: owner-tiff@olympiakos.com

"Thies C. Arntzen" <thies@digicol.de> writes:
>> but i cannot process those using the latest tiff library (JPEG-Support
>> enabled).
>> i've tried to enable OJPEG_SUPPORT - but i can't find the needed
>> TIFFInitOJPEG() function anywhere in the source code....

There never has been, and probably never will be, any OJPEG support in
the libtiff distribution --- only stubs.  The old spec is too ambiguous
to allow building a reliable reader for it (see TIFF Tech Note #2 for
the gory details).

What's worse, most of the attempted implementations I've seen files from
are demonstrably broken.  Your example is broken in at least two ways:

1. Your dump shows PhotometricInterpretation = 5 (ie, CMYK) and
SamplesPerPixel = 3.  I don't think so ... one of those has to be wrong.
Probably the PhotometricInterpretation ought to be YCbCr, since there's
a YCbCrPositioning tag.  On the other hand, YCbCr mode requires
ReferenceBlackWhite to be given, and it isn't.  (Congratulations to
whoever this was on finding a novel new way to screw up an old-style
TIFF/JPEG.)

2. Old-style JPEG mode requires a bunch of support fields; at minimum
JPEGQTables, JPEGDCTables, and JPEGACTables, which are nowhere to be
seen in the dump.  There is no way for an OJPEG-compliant reader to
do anything at all with this file.

Given point 2, it seems possible that what you really have here is
a file with a complete JPEG datastream inside the one data strip.
Which would mean it's really new-style TIFF/JPEG with a wrong
compression tag.  You might try changing the compression tag to 7,
fixing the colorspace description, and seeing what happens.
(But first, take a look with something like jpegdump to see if there
are any JPEG markers inside the data strip.  If not, you're pretty
well hosed, I fear; the file must be depending on assumed table values,
and there's no way to guess what Q tables to use...)

Thad Humphries <thad@blueridge.com> writes:
> You might try what I did--closely examine the way OJPEG was
> implemented in the files you must work with, extract from them a JPEG file
> which you write to a temp file on disk, then do the decompression with
> libjpeg.

Yup, it seems that each alleged OJPEG file I run across requires a
fresh reverse-engineering effort to figure out what creative
misinterpretation of the spec was used...

			regards, tom lane
			organizer, Independent JPEG Group
