2000.02.02 17:50 "Microsoft Imaging and Jpeg in TIFF", by Randall Myers

2000.02.02 21:35 "Re: Microsoft Imaging and Jpeg in TIFF", by Andy


I will tell you some things about Wang TIFF/J images.

One is that they use the "OJPEG" tags JPEGInterchangeFileOffset(TIFFTAG_JPEGIFOFFSET) and JPEGInterchangeFileLength (TIFFTAG_JPEGIFBYTECOUNT). What this is the the beginning of the JPEG stream. Add to this the contents of each strip, raw, and there is the complete JPEG data stream.

Or is it?

I was doing some research as I wasn to extract only a valid JPEG data stream from a Wang TIFF image. So the procedure described above gets what appears to be a JPEG data stream, starting with FF'D8' marker and ending with FF'D9'.

This data stream, even with an attached JFIF header, is not viewable in other regular softwares (browser, PSP) nor valid as a PostScript DCTDecode stream.

Below is a short dump of this JPEG data stream, sans JFIF marker:

Image #01:  SOI @ 000000
            EOI @ 00C5E7

----- [   Structure Analysis of file: 101020.jpg   ]-----

000000 :  --- Marker
  Start of Image 01

000002 :  --- Marker
  Comment: WANG<

00000C :  --- Marker
  Define Quantization Table(s)
  Lq = 0043 - Quantization Table Definition Length
  Pq =    0 - Quantization Table Element Precision
              8-Bit elemental precision
  Tq =    0 - Quantization Table Identifier

000051 :  --- Marker
  Baseline DCT - Non-Differential Huffman Coding
  Lf = 000B - Length of the Frame Header
  P  = 08   - Sample Precision
  Y  = 07C8 - Number of Lines in Source Image
  X  = 04F8 - Number of Samples Per Line
  Nf = 01   - Number of Frame Components

00005E :  --- Marker
  Define Huffman Table(s) - Huffman Table Specs
  Lh = 001F - Huffman Table Definition Length
  Tc =    0 - Table Class is: Lossless Method
  Th =    0 - Huffman Table Identifier

00007F :  --- Marker
  Define Huffman Table(s) - Huffman Table Specs
  Lh = 00B5 - Huffman Table Definition Length
  Tc =    1 - Table Class is: AC Table Method
  Th =    0 - Huffman Table Identifier

000136 :  --- Marker
  Start of Scan
  Ls = 0008 - Scan Header Length
  Ns =   01 - Number of Image Components

   Values below are in decimal:
  Cs_[1..1] = Scan Component Selector
  Td_[1..1] = DC Entropy Coding Table Selector
  Ta_[1..1] = AC Entropy Coding Table Selector

  Ss = 00 - Start of Spectral or Predictor Selection
  Se = 3F - End of Spectral Selection
  Ah = 00 - Successive approximation bit position high
  Al = 00 - Successive approximation bit position low

00C5E7 :  --- Marker
  End of Image 01

So, I wonder if some of these values are misnamed, or otherwise invalid, or of it is an ISO specification valid JPEG data stream that other softwares view not.

I have not tried to open this stream using libjpeg 6b, I think that would be something to try to see if valid data could be garnered without hack from this Wang "JPEG" data stream.

Whether this behavior is changed in some present version of Eastman Software/Wang imaging, I do not know and do doubt.

I am interested to hear what others think of this. I will hack more on this JPEG data stream, perhaps it is only I have misordered the tags or strips or something, simply reading them.

I am hoping some JPEG expert will tell us the error, or not, of Wang's ways, or even better, the Wang engineer should explain.