Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-s.one.com (mx-s.one.com [91.198.169.250])
	by mail6.local (Postfix) with ESMTP id 33DA68014D6E0
	for <filtered@awaresystems.be>; Wed, 19 Dec 2012 17:14:21 +0100 (CET)
X-Virus-Scanned: by one.com
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
Received-SPF: pass (mx-s: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.212.43 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-vb0-f43.google.com (mail-vb0-f43.google.com [209.85.212.43])
	by mx-s.one.com (Postfix) with ESMTP id B496C73E42C
	for <filtered@awaresystems.be>; Wed, 19 Dec 2012 16:14:20 +0000 (UTC)
Received: by mail-vb0-f43.google.com with SMTP id fs19so2482019vbb.2
        for <filtered@awaresystems.be>; Wed, 19 Dec 2012 08:14:20 -0800 (PST)
X-Received: by 10.220.228.1 with SMTP id jc1mr9361141vcb.74.1355933659851;
        Wed, 19 Dec 2012 08:14:19 -0800 (PST)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.58.144.166 with SMTP id sn6csp26164veb;
        Wed, 19 Dec 2012 08:14:19 -0800 (PST)
X-Received: by 10.52.66.71 with SMTP id d7mr8304852vdt.121.1355933658442;
        Wed, 19 Dec 2012 08:14:18 -0800 (PST)
Received-SPF: neutral (google.com: 91.198.169.55 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=91.198.169.55;
Received: by 10.230.201.143 with POP3 id fa15mf1612056vbb.37;
        Wed, 19 Dec 2012 08:14:18 -0800 (PST)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-h.one.com (mx-h.one.com [91.198.169.55])
	by mail6.local (Postfix) with ESMTP id 4D7F880150A86
	for <info@awaresystems.be>; Wed, 19 Dec 2012 17:12:42 +0100 (CET)
X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "MIME-Version"
X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-h.one.com (Postfix) with ESMTP id 15855AC6FE9
	for <info@awaresystems.be>; Wed, 19 Dec 2012 16:12:41 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id D51F535C03B;
	Wed, 19 Dec 2012 11:11:15 -0500 (EST)
Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com
	[209.85.220.51])
	by lists.maptools.org (Postfix) with ESMTPS id EE2EF35C03E
	for <tiff@lists.maptools.org>; Wed, 19 Dec 2012 11:04:36 -0500 (EST)
Received: by mail-pa0-f51.google.com with SMTP id fb11so1410469pad.24
	for <tiff@lists.maptools.org>; Wed, 19 Dec 2012 08:04:35 -0800 (PST)
MIME-Version: 1.0
Received: by 10.66.73.132 with SMTP id l4mr18583926pav.48.1355933074748; Wed,
	19 Dec 2012 08:04:34 -0800 (PST)
Received: by 10.68.39.42 with HTTP; Wed, 19 Dec 2012 08:04:34 -0800 (PST)
In-Reply-To: <alpine.GSO.2.01.1212190849110.19664@freddy.simplesystems.org>
References: <CA+y9FkoH9woUYaqadt6Kx3NgDjF++DxA_14UxR7Kv3EsSmZ-4Q@mail.gmail.com>
	<CA+y9FkpQ+ZmRgHXjHVebLB+gN-m_2+iNZpRupgrRbs+MmszmzA@mail.gmail.com>
	<alpine.GSO.2.01.1212190849110.19664@freddy.simplesystems.org>
Date: Wed, 19 Dec 2012 21:34:34 +0530
Message-ID: <CA+y9FkrqTDEk0f+mUZSi9nLOogt2n2W84CibaAjwG19pHbdbOg@mail.gmail.com>
From: swagat mishra <swagatmishra2007@gmail.com>
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>, tiff@lists.maptools.org
Subject: Re: [Tiff] decoding tiff images with ycbcr and jpeg compression
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1838051344=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1838051344==
Content-Type: multipart/alternative; boundary=f46d042f92524275dd04d136c5fd

--f46d042f92524275dd04d136c5fd
Content-Type: text/plain; charset=ISO-8859-1

sorry for the triple post. I wasnt seeing it being successfully posted and
kept retrying...my bad.
I am trying to use TiffReadRGBAImage as i always need the output in 32 bpp
rgba and dont need the fine grained control offered by TiffReadEncodedStrip.
Shouldnt using  TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE,
JPEGCOLORMODE_RGB ), work with TiffReadrgbaImage as well, as it uses
TiffReadEncodedStrip in the background?
Or is there any other way to hack this functionality into TiffReadRgbaImage?
On Wed, Dec 19, 2012 at 8:28 PM, Bob Friesenhahn <
bfriesen@simple.dallas.tx.us> wrote:

> On Tue, 18 Dec 2012, swagat mishra wrote:
>
>        hi,
>> I am trying to decode the quad-jpeg.tif image with the TiffReadRgbaImage
>> interface. My libtiff version
>> is 4.0.2 and it is compiled with support for jpeg,lzw,libz and other
>> compression schemes.
>> TiffReadRgbaImage returns true but i get a completely black image,instead
>> of the actual image.
>> I went through previous posts on the mailing list and it seems this is  a
>> bug in 4.x.x . Suggested fix
>> was to set tiff tag JPEGCOLORMODE to RGB. However that did not work.
>> Can anyone help me with this?
>>
>
> I see that you have now posted your email three times already.  Your email
> does get through.  It is just that no one has responded.
>
> Using GraphicsMagick and libtiff 4.0.3 I am able to load quad-jpeg.tif
> without any problems.  While TIFFReadRGBAImage() may be simple to use, it
> does not support all TIFF subformats.
>
> For this file, GraphicsMagick uses TIFFReadEncodedStrip().  It does use
> this hack to cause libjpeg to do the conversion from ycbcr to RGB:
>
>   TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );
>
> After applying this hack, the subsequent code should behave as if the
> image uses PHOTOMETRIC_RGB rather than PHOTOMETRIC_YCBCR.
>
> Bob
> --
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/**
> users/bfriesen/ <http://www.simplesystems.org/users/bfriesen/>
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

--f46d042f92524275dd04d136c5fd
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>sorry for the triple post.=A0I wasnt seeing it being successfully post=
ed and kept retrying...my bad.</div><div>I am trying to use TiffReadRGBAIma=
ge as i always need the output in 32 bpp rgba and dont need the fine graine=
d control offered by TiffReadEncodedStrip.</div>
<div>Shouldnt using=A0 TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLOR=
MODE_RGB ), work with TiffReadrgbaImage as well, as it uses TiffReadEncoded=
Strip in the background?<br>Or is there any other way to hack this function=
ality into TiffReadRgbaImage?<br>
</div><div class=3D"gmail_quote">On Wed, Dec 19, 2012 at 8:28 PM, Bob Fries=
enhahn <span dir=3D"ltr">&lt;<a href=3D"mailto:bfriesen@simple.dallas.tx.us=
" target=3D"_blank">bfriesen@simple.dallas.tx.us</a>&gt;</span> wrote:<br><=
blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-c=
olor:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class=
=3D"gmail_quote">
<div class=3D"HOEnZb"><div class=3D"h5">On Tue, 18 Dec 2012, swagat mishra =
wrote:<br>
<br>
<blockquote style=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-=
color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class=
=3D"gmail_quote">
=A0 =A0 =A0 hi,<br>
I am trying to decode the quad-jpeg.tif image with the TiffReadRgbaImage in=
terface. My libtiff version<br>
is 4.0.2 and it is compiled with support for jpeg,lzw,libz and other compre=
ssion schemes.<br>
TiffReadRgbaImage returns true but i get a completely black image,instead o=
f the actual image.<br>
I went through previous posts on the mailing list and it seems this is=A0 a=
 bug in 4.x.x . Suggested fix<br>
was to set tiff tag JPEGCOLORMODE to RGB. However that did not work.<br>
Can anyone help me with this?<br>
</blockquote>
<br></div></div>
I see that you have now posted your email three times already. =A0Your emai=
l does get through. =A0It is just that no one has responded.<br>
<br>
Using GraphicsMagick and libtiff 4.0.3 I am able to load quad-jpeg.tif with=
out any problems. =A0While TIFFReadRGBAImage() may be simple to use, it doe=
s not support all TIFF subformats.<br>
<br>
For this file, GraphicsMagick uses TIFFReadEncodedStrip(). =A0It does use t=
his hack to cause libjpeg to do the conversion from ycbcr to RGB:<br>
<br>
=A0 TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );<br>
<br>
After applying this hack, the subsequent code should behave as if the image=
 uses PHOTOMETRIC_RGB rather than PHOTOMETRIC_YCBCR.<span class=3D"HOEnZb">=
<font color=3D"#888888"><br>
<br>
Bob<br>
-- <br>
Bob Friesenhahn<br>
<a href=3D"mailto:bfriesen@simple.dallas.tx.us" target=3D"_blank">bfriesen@=
simple.dallas.tx.us</a>, <a href=3D"http://www.simplesystems.org/users/bfri=
esen/" target=3D"_blank">http://www.simplesystems.org/<u></u>users/bfriesen=
/</a><br>

GraphicsMagick Maintainer, =A0 =A0<a href=3D"http://www.GraphicsMagick.org/=
" target=3D"_blank">http://www.GraphicsMagick.org/</a></font></span></block=
quote></div><br>

--f46d042f92524275dd04d136c5fd--

--===============1838051344==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============1838051344==--
