Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx008.isp.belgacom.be (inmx008.isp.belgacom.be [195.238.3.88])
        by mailst006.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i6MJkpDc011555
        for <joris.at.lebbeke@skynet.be>; Thu, 22 Jul 2004 21:46:51 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx008.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i6MJkbUO017562
        for <joris.at.lebbeke@skynet.be>; Thu, 22 Jul 2004 21:46:40 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 5EC61156251; Thu, 22 Jul 2004 15:46:14 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from ahk.pu.ru (ahk.pu.ru [193.124.85.198])
	by xserve.flids.com (Postfix) with ESMTP id 6629815622D
	for <tiff@remotesensing.org>; Thu, 22 Jul 2004 15:46:11 -0400 (EDT)
Received: from wg.pu.ru (wg.pu.ru [193.124.85.219])
	by ahk.pu.ru (8.12.11/8.12.9) with ESMTP id i6MJkA7m031138
	for <tiff@remotesensing.org>; Thu, 22 Jul 2004 23:46:10 +0400 (MSD)
	(envelope-from dron@ak4719.spb.edu)
Received: (from uucp@localhost)
	by wg.pu.ru (8.9.1a/8.9.1) with UUCP id TAA27705
	for tiff@remotesensing.org; Thu, 22 Jul 2004 19:46:10 GMT
Received: from ak4719.spb.edu (localhost [127.0.0.1])
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id
	i6MJluCh009574
	for <tiff@remotesensing.org>; Thu, 22 Jul 2004 23:47:56 +0400
Received: (from dron@localhost)
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) id i6MJluOC009570
	for tiff@remotesensing.org; Thu, 22 Jul 2004 23:47:56 +0400
From: Andrey Kiselev <dron@ak4719.spb.edu>
Date: Thu, 22 Jul 2004 23:47:56 +0400
To: tiff@remotesensing.org
Subject: Re: [Tiff] JPEG Compression Support
Message-ID: <20040722194756.GC6760@ak4719.spb.edu>
Mail-Followup-To: tiff@remotesensing.org
References: <000d01c46ee3$7fd9fac0$69fea8c0@SIDVZLA>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <000d01c46ee3$7fd9fac0$69fea8c0@SIDVZLA>
X-GnuPG-Key: http://www.srces.spb.org/dron/export.home.key
X-Face: "t+se9s~+y~[XUH]L|pmeO3Pt/Q@DNv**S, d@_1-C=}/,
	c%<3Qp]eu!ok<"2lYJm$!9qVcg F?7o*L; |$`6|Q|>Rt-cU%2_y@6tQ|`!Li}TsvZvEKx;
	>fuY=fc(=sX^`7Wmw8%SsR`AvM$a; 0U/eN\ P?B\FTyqD, 0np$U2!*'z_4D,
	VPlFf?bN0&zYf"zF0s!7Tl7?$we)xD0@lL>[h|8bhys0i.g|zLnu@C
	Ti@d]i=[!:j1CB\5/TF[m]`lfHfaqSN[0qn@T3zeosV/[LAss{@p_?],x*j8P_9t[}uHD^X-;
	j~\M! gyTly;fj`}&Y~i{<#bN.#QmkE}#T`dxP.I1\.)_MEN{@#W
User-Agent: Mutt/1.5.6i
X-Virus-Scanned: clamd / ClamAV version 0.72, clamav-milter version 0.72
	on ak4719.spb.edu
X-Virus-Status: Clean
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 2f473e9ddec491d92c80fb6d99fd1938

Hi, Jean,

On Wed, Jul 21, 2004 at 01:28:00AM -0400, Jean Paul Mir V. wrote:
> I'm working on a C++ ATL component for TIFF conversion to PCL, PS And
> PDF. Actually I have completed TiffToPCL and TiffToPS translation
> based on tiff2ps and tifftopcl tools of libtiff.

Hmm, I don't remember the tifftopcl tool in libtiff, but probably you
can contribute something to our library? ;-)

> Everything works fine until I started using Grayscale and Color Images
> using JPEG compression. After many errors I successfully created
> libtiff.lib, but when I tried to convert the file using my ATL I got
> so many errors regarding unrecognized tags and so on. One of those
> alerts saids "Old-Style JPEG Support is not installed"... then I
> enabled OJPEG compression and recompile it again.

You (or your customers) are using so called 'Old-style JPEG
compression'. It is partially supported by libtiff, by you should not
rely on that support.

> At this time I got an error like "..._ jpeg_reset_huff_decode
> unrecognized... " or something like that...
> 
> I searched on internet and found an article saying that I would need
> to patch libtiff to add OJPEG support to the library.. I could not
> patch the library but I found the missing function:
> 
> GLOBAL(void)
>  jpeg_reset_huff_decode (register j_decompress_ptr cinfo)
>  { register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
>    register int ci = 0;
>  
>    /* Discard encoded input bits, up to the next Byte boundary */
>    entropy->bitstate.bits_left &= ~7;
>    /* Re-initialize DC predictions to 0 */
>    do entropy->saved.last_dc_val[ci] = 0; while (++ci < cinfo->comps_in_scan);
>  }
> 
> I just copy-paste it into jduff.c and then the compilation ends up
> successfully.

You don't need to search internet, because all instructions are in the
contrib/ojpeg directory of the libtiff package. There is a patch which
should be applied to libjpeg sources.

> Once I got the library and my DLL compiled(after Library compilation),
> I tried to convert a JPEG Compressed tiff file to a PCL file and all I
> got is a full of gray lines page.
> 
> Could someone tell me how could I build propertly the library with
> support for JPEG and OJPEG compression ???

Unfortunately the 'old-style' JPEG compression is not supported by the
upstream libtiff developers. You have the two choices:

1. Dig into the problem yourself (and contribute the patches back to us ;-)
2. Force your users to drop out their software producing old style JPEGs
   and switch them to the latest TIFF standard.

Of course, you may send the problematic files to us, but it is no
guarantees that the problem will be fixed shortly, sorry.

						Andrey

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
