Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx-x.one.com (mx-x.one.com [195.47.247.149])
	by mail6.local (Postfix) with ESMTP id 9668430017E2C3
	for <filtered@awaresystems.be>; Fri,  9 May 2014 03:30:10 +0000 (UTC)
X-Virus-Scanned: by one.com
Received-SPF: pass (mx-x: domain of awaresystems.be+caf_=filtered=awaresystems.be@gmail.com designates 209.85.217.178 as permitted sender)
X-Greylist: whitelisted by SQLgrey-1.8.0-rc2
Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178])
	by mx-x.one.com (Postfix) with ESMTP id 6A4B722DAF934
	for <filtered@awaresystems.be>; Fri,  9 May 2014 03:30:10 +0000 (UTC)
Received: by mail-lb0-f178.google.com with SMTP id w7so4862905lbi.23
        for <filtered@awaresystems.be>; Thu, 08 May 2014 20:30:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-original-authentication-results:delivered-to:delivered-to
         :message-id:date:from:user-agent:mime-version:to:references
         :in-reply-to:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe:content-type
         :content-transfer-encoding:sender:errors-to;
        bh=l54PYmi5ZbU1SjUUvix9dJuFzUKO3PIEZwejc/cs+Vg=;
        b=E3JjyKJtqLZoT7OO6S8tg6RhJQMZ8J+DGxoMAFUmPEoQabHz6QwXxkPPsFnIE1Ar10
         AficENYhd9F2wRrEACM+qAkkbSQ5gXSCl4twJve7KhaVN5td6E+fyLCZX4E9fqQMGsvY
         Mg6/lIPy5AU3ACggbm2b+2Tc9iRc/3GK8hFqRVEWjgoxBPkAVbnIFdtF3bx2NVGE45GW
         whnnrzi+m5sctio/l/IaId2XScpSLoWBM4qbnoaPdSE3bp5PG2zrqappelpbkd3PtjsL
         r32mWMq4jMEDmZ7FTbY1TjhWa1HKGyEF3neu3r7BlOvb8OQyyviFV+M++B0YW6wQySe/
         nhWg==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
X-Received: by 10.112.41.101 with SMTP id e5mr169542lbl.46.1399606209897;
        Thu, 08 May 2014 20:30:09 -0700 (PDT)
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.114.11.132 with SMTP id q4csp97266ldb;
        Thu, 8 May 2014 20:30:09 -0700 (PDT)
X-Received: by 10.112.150.103 with SMTP id uh7mr9290002lbb.30.1399606207637;
        Thu, 08 May 2014 20:30:07 -0700 (PDT)
Authentication-Results: mx.google.com;
       spf=neutral (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) smtp.mail=tiff-bounces@lists.maptools.org
Received-SPF: none (google.com: tiff-bounces@lists.maptools.org does not designate permitted sender hosts) client-ip=91.198.169.51;
Received: by 10.112.0.202 with POP3 id 10mf2473227lbg.5;
        Thu, 08 May 2014 20:30:07 -0700 (PDT)
X-Gmail-Fetch-Info: info@awaresystems.be 1 pop.awaresystems.be 110 info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-d.one.com (mx-d.one.com [91.198.169.51])
	by mail6.local (Postfix) with ESMTP id 7899E3001843E7
	for <info@awaresystems.be>; Fri,  9 May 2014 02:54:51 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2
Received: from lists.maptools.org (ks365428.kimsufi.com [94.23.4.142])
	by mx-d.one.com (Postfix) with ESMTP id 464504E9680
	for <info@awaresystems.be>; Fri,  9 May 2014 02:54:50 +0000 (UTC)
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id BF4D135C025;
	Thu,  8 May 2014 21:54:12 -0500 (EST)
Received: from iguard15-136.static.hkbn.net (iguard15-136.static.hkbn.net
	[61.92.211.136])
	by lists.maptools.org (Postfix) with ESMTP id DF4D035C025
	for <tiff@lists.maptools.org>; Thu,  8 May 2014 21:53:06 -0500 (EST)
Received: from outguard01.hkbn.net ([203.186.94.187])
	by iguard15.hkbn.net with ESMTP; 09 May 2014 10:52:28 +0800
Received: from outguard01.hkbn.net (unknown [127.0.0.1])
	by IMSVA (Postfix) with ESMTP id DC3143D0085
	for <tiff@lists.maptools.org>; Fri,  9 May 2014 10:53:03 +0800 (HKT)
Received: from smtp1o.ctimail.com (unknown [203.186.94.57])
	by outguard01.hkbn.net (Postfix) with ESMTP id C68633D0074
	for <tiff@lists.maptools.org>; Fri,  9 May 2014 10:53:03 +0800 (HKT)
Received: from haswell.coppice.org (123203240102.ctinets.com [123.203.240.102])
	by smtp1o.ctimail.com (8.14.5/8.14.5) with ESMTP id s492r14D024105
	for <tiff@lists.maptools.org>; Fri, 9 May 2014 10:53:03 +0800
Message-ID: <536C430D.3010607@coppice.org>
Date: Fri, 09 May 2014 10:53:01 +0800
From: Steve Underwood <steveu@coppice.org>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:24.0) Gecko/20100101 Thunderbird/24.5.0
MIME-Version: 1.0
To: tiff@lists.maptools.org
References: <CAHjiUbpE=rBdVpspeb4kFhfp9Vfrbd=2t4ZooYhcQBFDugEJQw@mail.gmail.com>
In-Reply-To: <CAHjiUbpE=rBdVpspeb4kFhfp9Vfrbd=2t4ZooYhcQBFDugEJQw@mail.gmail.com>
X-TM-AS-Product-Ver: IMSVA-8.2.0.1391-7.5.0.1017-20682.004
X-TM-AS-Result: No--12.994-9.9-31-10
X-imss-scan-details: No--12.994-9.9-31-10;No--12.994-5.0-31-10
X-TMASE-Version: IMSVA-8.2.0.1391-7.5.1017-20682.004
X-TMASE-Result: 10--12.993700-5.000000
X-TMASE-MatchedRID: cgbqQT5W8he+cA2OBw2FFkhEDfw/93Bu+ccIIOk4Y47I9EDAP/dptiUq
	kgbo0Bs5FzVDISTKI1fXOZ8nZo8q0DurH0qx1kBYc+QhWKJM04N3T8gwfPR6+aXJ9vMysD/CyRS
	EpZz6DA8bp/29sIMmgtpjbOJAZP5SU6k75K+J6PAc8J6ZrWP/q4N12XKYbuJLmyiLZetSf8nJ4y
	0wP1A6AOFYM+IjwPfzjaPj0W1qn0Q7AFczfjr/7KDGgwEZCHM4/qey6/M15mcLmlQQeqNmX8HZN
	308g5rn9A3qHqDkL6A=
Subject: Re: [Tiff] what's up with all the seeking?
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: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Hi Jeff,

Yes, TIFF is fundamentally incompatible with streaming. There are some 
TIFF related specs, such as the earliest RFCs on TIFF for internet FAX, 
which try to impose rules which would allow TIFF to be effectively 
streamed. In practice those specs failed.

The main issue is you can only interpret the contents of the file by 
following the directories, and the directories can be anywhere. In most 
TIFF files you will find the directory for a page right after the image 
data for that page. This makes sense from a sequential file generation 
point of view, as typically you don't fully know what the directory 
should contain until you have generated the entire image. It does, 
however, mean that on reading the TIFF file you need to seek beyond the 
image to get to the directory which tells you the extent of the image 
data, and how to interpret its contents.

Regards,
Steve

On 05/09/2014 07:14 AM, Jeff Breidenbach wrote:
> Is TIFF fundamentally incompatible with streaming?
>
> ===
>
> #include <tiffio.h>
> #include <stdio.h>
>
> main() {
>   TIFF *tiff = TIFFFdOpen(fileno(stdin), "stdin", "rb");
>   TIFFClose(tiff);
> }
>
> ===
>
> $ gcc -o mypgram mypgram.c -ltiff
> $ pbmmake 1000 1000 | pnmtotiff -g4 > foo tif
> $ myprogram < foo.tif
>
> TIFFFetchDirectory: stdin: Seek error accessing TIFF directory.
> TIFFReadDirectory: Failed to read directory at offset 40.
> Segmentation fault (core dumped)
>
>
>
>
>
> _______________________________________________
> Tiff mailing list: Tiff@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

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