Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-h.b-one.net (mx-h.one.com [91.198.169.55])
	by mail9.b-one.net (Postfix) with ESMTP id 5135A400125
	for <info@awaresystems.be>; Tue, 17 Feb 2009 07:29:29 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=0 required=6
	tests=[HTML_MESSAGE=0.001]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144])
	by mx-h.b-one.net (Postfix) with ESMTP id 70AA918000DF
	for <info@awaresystems.be>; Tue, 17 Feb 2009 07:29:28 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id D02B61D18FB26;
	Tue, 17 Feb 2009 01:28:46 -0500 (EST)
Received: from mail-fx0-f20.google.com (mail-fx0-f20.google.com
	[209.85.220.20])
	by lists.maptools.org (Postfix) with ESMTP id 991601D18FB2A
	for <tiff@lists.maptools.org>; Tue, 17 Feb 2009 01:00:30 -0500 (EST)
Received: by fxm13 with SMTP id 13so6208492fxm.21
	for <tiff@lists.maptools.org>; Mon, 16 Feb 2009 22:00:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.223.116.77 with SMTP id l13mr246593faq.106.1234850429360; Mon, 
	16 Feb 2009 22:00:29 -0800 (PST)
In-Reply-To: <2C8CDA89BA7EEB45894477CF82AC198A01811B5AC3D0@nambx03.corp.adobe.com>
References: <7f9533b10902161635g7e51c1abpd7ed5b34c6ad4c2e@mail.gmail.com>
	<2C8CDA89BA7EEB45894477CF82AC198A01811B5AC3D0@nambx03.corp.adobe.com>
Date: Mon, 16 Feb 2009 22:00:29 -0800
Message-ID: <7f9533b10902162200x3c2d5634k6b0a0b2756e2a84d@mail.gmail.com>
From: Gordon Wetzstein <gordon.wetzstein@gmail.com>
To: "tiff@lists.maptools.org" <tiff@lists.maptools.org>
Subject: Re: [Tiff] DNG question
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="===============1583125432=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

--===============1583125432==
Content-Type: multipart/alternative; boundary=001636c5afb6315bb3046317058a

--001636c5afb6315bb3046317058a
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hey guys,

thanks for the answers. I had a look at dcraw, which is a great tool, but
I'm working on some de-mosaicking algorithms, so I need the CFA data. There
is some sample code for a simple c DNG exporter (elphel_dng.c), which uses
different TIFF
directories to store the thumbnail and the raw data. Unfortunately, my DNG
files only have a single TIFF directory when I open them. I can extract the
RAW data with dcraw, but the code is somewhat cryptic, so I don't quite
understand how to access it. Since I use the Adobe DNG converter to create
the files from various different SLR cameras, I can just set the compression
to none, so that shouldn't be a problem.

I saw that Dave Coffin has a patch for libTIFF 3.8.2 on his website, but I'm
using Windows XP and don't quite know how to apply that patch to my libTIFF.
Maybe I'll give that another shot.

I also had a look at the DNG SDK, but it seems huge I would like to keep my
stuff as simple as possible.

Thanks for your help.

Gordon

On Mon, Feb 16, 2009 at 8:53 PM, Chris Cox <ccox@adobe.com> wrote:

> You might be better off using the DNG SDK instead of LibTIFF.
>
> Chris
>
> ________________________________________
> From: tiff-bounces@lists.maptools.org [tiff-bounces@lists.maptools.org] On
> Behalf Of Gordon Wetzstein [gordon.wetzstein@gmail.com]
> Sent: Monday, February 16, 2009 4:35 PM
> To: tiff@lists.maptools.org
> Subject: [Tiff] DNG question
>
> Sorry for another newbie question, but I'm trying to read DNG files with
> libTIFF 3.8.2.
>
> I have converted my Nikon RAW files to DNG using the Adobe DNG converter.
> dcraw can correctly read the files, so they should be fine. Unfortunately, I
> cannot access the RAW data in the file from my program.
>
> If I just open the TIFF file and read the tags, I only access the
> thumbnail, because the image size is smaller and I have an RGB image. I want
> the RAW mosaic data, however. Calling 'TIFFReadDirectory' until it returns 0
> tells me that there is only one subfile in the TIFF, so no need to bother
> trying to change the TIFF directory.
>
> I also tried to get a subimage with:
>
> uint16 numSubimages;
> uint32 subimageOffset[256];
> TIFFGetField(tif, TIFFTAG_SUBIFD, &numSubimages, &subimageOffset );
>
> numSubimages is always 1. Does that mean that there is one more subimage
> that I can access via TIFFSetSubDirectory(tif, subimageOffset[0]) or does it
> mean that there is only the thumbnail? If the latter is the case, how can I
> access the RAW data?
>
> Any help is highly appreciated.
>
> Gordon
>
>
>

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

Hey guys,<br><br>thanks for the answers. I had a look at dcraw, which is a =
great
tool, but I&#39;m working on some de-mosaicking algorithms, so I need the
CFA data. There is some sample code for a simple c DNG exporter
(elphel_dng.c), which uses different TIFF<br>
directories to store the thumbnail and the raw data. Unfortunately, my
DNG files only have a single TIFF directory when I open them. I can
extract the RAW data with dcraw, but the code is somewhat cryptic, so I
don&#39;t quite understand how to access it. Since I use the Adobe DNG
converter to create the files from various different SLR cameras, I can
just set the compression to none, so that shouldn&#39;t be a problem.<br>
<br>I saw that Dave Coffin has a patch for libTIFF 3.8.2 on his
website, but I&#39;m using Windows XP and don&#39;t quite know how to apply
that patch to my libTIFF. Maybe I&#39;ll give that another shot.<br><br>I a=
lso had a look at the DNG SDK, but it seems huge I would like to keep my st=
uff as simple as possible.<br>
<br>Thanks for your help.<br><br>Gordon<br><br><div class=3D"gmail_quote">O=
n Mon, Feb 16, 2009 at 8:53 PM, Chris Cox <span dir=3D"ltr">&lt;<a href=3D"=
mailto:ccox@adobe.com">ccox@adobe.com</a>&gt;</span> wrote:<br><blockquote =
class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); m=
argin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You might be better off using the DNG SDK instead of LibTIFF.<br>
<br>
Chris<br>
<br>
________________________________________<br>
From: <a href=3D"mailto:tiff-bounces@lists.maptools.org">tiff-bounces@lists=
.maptools.org</a> [<a href=3D"mailto:tiff-bounces@lists.maptools.org">tiff-=
bounces@lists.maptools.org</a>] On Behalf Of Gordon Wetzstein [<a href=3D"m=
ailto:gordon.wetzstein@gmail.com">gordon.wetzstein@gmail.com</a>]<br>

Sent: Monday, February 16, 2009 4:35 PM<br>
To: <a href=3D"mailto:tiff@lists.maptools.org">tiff@lists.maptools.org</a><=
br>
Subject: [Tiff] DNG question<br>
<div><div></div><div class=3D"Wj3C7c"><br>
Sorry for another newbie question, but I&#39;m trying to read DNG files wit=
h libTIFF 3.8.2.<br>
<br>
I have converted my Nikon RAW files to DNG using the Adobe DNG converter. d=
craw can correctly read the files, so they should be fine. Unfortunately, I=
 cannot access the RAW data in the file from my program.<br>
<br>
If I just open the TIFF file and read the tags, I only access the thumbnail=
, because the image size is smaller and I have an RGB image. I want the RAW=
 mosaic data, however. Calling &#39;TIFFReadDirectory&#39; until it returns=
 0 tells me that there is only one subfile in the TIFF, so no need to bothe=
r trying to change the TIFF directory.<br>

<br>
I also tried to get a subimage with:<br>
<br>
uint16 numSubimages;<br>
uint32 subimageOffset[256];<br>
TIFFGetField(tif, TIFFTAG_SUBIFD, &amp;numSubimages, &amp;subimageOffset );=
<br>
<br>
numSubimages is always 1. Does that mean that there is one more subimage th=
at I can access via TIFFSetSubDirectory(tif, subimageOffset[0]) or does it =
mean that there is only the thumbnail? If the latter is the case, how can I=
 access the RAW data?<br>

<br>
Any help is highly appreciated.<br>
<br>
Gordon<br>
<br>
<br>
</div></div></blockquote></div><br>

--001636c5afb6315bb3046317058a--

--===============1583125432==
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/
--===============1583125432==--
