Read tiff file piped from stdout ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Read tiff file piped from stdout ?

Aaron Boxer
Is it possible to read a tiff file from stdout ?
I tried but I got an error :  "Seek error accessing directory"

My command line was:

cat foo.tiff |  some_program -i /dev/stdin -o bar

I did get this working with libpng, by the way.

Thanks,
Aaron

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Aaron Boxer

On Sat, Jul 1, 2017 at 10:21 AM, Aaron Boxer <[hidden email]> wrote:
Is it possible to read a tiff file from stdout ?
I tried but I got an error :  "Seek error accessing directory"

I guess you can't seek on a pipe ?  Is there a workaround for this ?

 


_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Even Rouault-2
In reply to this post by Aaron Boxer

On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:

> Is it possible to read a tiff file from stdout ?

 

In the general case, no. If the file has been specifically created for being read in a streamble way and the read access pattern is compatible of it, yes. You may read with interest the "Streaming operations" section at the end of

http://gdal.org/frmt_gtiff.html for more details

 

The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over standard stdin, with buffering of the first 1MB so that all seeking within this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no actual position change), or forward seeks.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Aaron Boxer
Thanks, Even. I will take a look. I suppose I could read the stream into memory, and then read from that.
Will vsistdin work on windows ?

On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]> wrote:

On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:

> Is it possible to read a tiff file from stdout ?

 

In the general case, no. If the file has been specifically created for being read in a streamble way and the read access pattern is compatible of it, yes. You may read with interest the "Streaming operations" section at the end of

http://gdal.org/frmt_gtiff.html for more details

 

The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over standard stdin, with buffering of the first 1MB so that all seeking within this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no actual position change), or forward seeks.

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com



_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Even Rouault-2

On samedi 1 juillet 2017 11:21:17 CEST Aaron Boxer wrote:

> Thanks, Even. I will take a look. I suppose I could read the stream into

> memory, and then read from that.

 

Sure. If your TIFF are small enough to hold in RAM, you'll of course be able to read any TIFF formulation that way.

 

> Will vsistdin work on windows ?

 

Yes

 

>

> On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]>

>

> wrote:

> > On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:

> > > Is it possible to read a tiff file from stdout ?

> >

> > In the general case, no. If the file has been specifically created for

> > being read in a streamble way and the read access pattern is compatible of

> > it, yes. You may read with interest the "Streaming operations" section at

> > the end of

> >

> > http://gdal.org/frmt_gtiff.html for more details

> >

> >

> >

> > The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over

> > standard stdin, with buffering of the first 1MB so that all seeking within

> > this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no

> > actual

> > position change), or forward seeks.

> >

> >

> >

> > Even

> >

> >

> >

> > --

> >

> > Spatialys - Geospatial professional services

> >

> > http://www.spatialys.com

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: Read tiff file piped from stdout ?

Aaron Boxer

---------- Forwarded message ----------
From: Aaron Boxer <[hidden email]>
Date: Sat, Jul 1, 2017 at 11:28 AM
Subject: Re: [Tiff] Read tiff file piped from stdout ?
To: Even Rouault <[hidden email]>




On Sat, Jul 1, 2017 at 11:23 AM, Even Rouault <[hidden email]> wrote:

On samedi 1 juillet 2017 11:21:17 CEST Aaron Boxer wrote:

> Thanks, Even. I will take a look. I suppose I could read the stream into

> memory, and then read from that.

 

Sure. If your TIFF are small enough to hold in RAM, you'll of course be able to read any TIFF formulation that way.

 

> Will vsistdin work on windows ?

 

Yes



Cool. So, on linux, I am using /dev/stdin as my source file.  Is there an equivalent name for this on windows ?

 

 

>

> On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]>

>

> wrote:

> > On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:

> > > Is it possible to read a tiff file from stdout ?

> >

> > In the general case, no. If the file has been specifically created for

> > being read in a streamble way and the read access pattern is compatible of

> > it, yes. You may read with interest the "Streaming operations" section at

> > the end of

> >

> > http://gdal.org/frmt_gtiff.html for more details

> >

> >

> >

> > The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over

> > standard stdin, with buffering of the first 1MB so that all seeking within

> > this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no

> > actual

> > position change), or forward seeks.

> >

> >

> >

> > Even

> >

> >

> >

> > --

> >

> > Spatialys - Geospatial professional services

> >

> > http://www.spatialys.com

 

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com




_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Scott Ribe
In reply to this post by Aaron Boxer
Why not create a temporary file?

> On Jul 1, 2017, at 9:21 AM, Aaron Boxer <[hidden email]> wrote:
>
> Thanks, Even. I will take a look. I suppose I could read the stream into memory, and then read from that.
> Will vsistdin work on windows ?
>
> On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]> wrote:
> On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:
> > Is it possible to read a tiff file from stdout ?
>  
> In the general case, no. If the file has been specifically created for being read in a streamble way and the read access pattern is compatible of it, yes. You may read with interest the "Streaming operations" section at the end of
> http://gdal.org/frmt_gtiff.html for more details
>  
> The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over standard stdin, with buffering of the first 1MB so that all seeking within this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no actual position change), or forward seeks.
>  
> Even
>  
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
> _______________________________________________
> Tiff mailing list: [hidden email]
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

--
Scott Ribe
[hidden email]
(303) 722-0567

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Aaron Boxer


On Sat, Jul 1, 2017 at 12:06 PM, scott ribe <[hidden email]> wrote:
Why not create a temporary file?

Yes,that could work. You mean in /dev/shm   ?
 

> On Jul 1, 2017, at 9:21 AM, Aaron Boxer <[hidden email]> wrote:
>
> Thanks, Even. I will take a look. I suppose I could read the stream into memory, and then read from that.
> Will vsistdin work on windows ?
>
> On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]> wrote:
> On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:
> > Is it possible to read a tiff file from stdout ?
>
> In the general case, no. If the file has been specifically created for being read in a streamble way and the read access pattern is compatible of it, yes. You may read with interest the "Streaming operations" section at the end of
> http://gdal.org/frmt_gtiff.html for more details
>
> The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over standard stdin, with buffering of the first 1MB so that all seeking within this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no actual position change), or forward seeks.
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
> _______________________________________________
> Tiff mailing list: [hidden email]
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

--
Scott Ribe
[hidden email]
<a href="tel:%28303%29%20722-0567" value="+13037220567">(303) 722-0567



_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Aaron Boxer
In reply to this post by Scott Ribe


On Sat, Jul 1, 2017 at 12:06 PM, scott ribe <[hidden email]> wrote:
Why not create a temporary file?

I guess the downside is increased memory usage.
 

> On Jul 1, 2017, at 9:21 AM, Aaron Boxer <[hidden email]> wrote:
>
> Thanks, Even. I will take a look. I suppose I could read the stream into memory, and then read from that.
> Will vsistdin work on windows ?
>
> On Sat, Jul 1, 2017 at 10:52 AM, Even Rouault <[hidden email]> wrote:
> On samedi 1 juillet 2017 10:21:12 CEST Aaron Boxer wrote:
> > Is it possible to read a tiff file from stdout ?
>
> In the general case, no. If the file has been specifically created for being read in a streamble way and the read access pattern is compatible of it, yes. You may read with interest the "Streaming operations" section at the end of
> http://gdal.org/frmt_gtiff.html for more details
>
> The GDAL /vsistdin/ special file mentionned in it is mostly a wrapper over standard stdin, with buffering of the first 1MB so that all seeking within this first MB works. Beyond /vsistdin/, only accepts dummy seeks (no actual position change), or forward seeks.
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
> _______________________________________________
> Tiff mailing list: [hidden email]
> http://lists.maptools.org/mailman/listinfo/tiff
> http://www.remotesensing.org/libtiff/

--
Scott Ribe
[hidden email]
<a href="tel:%28303%29%20722-0567" value="+13037220567">(303) 722-0567



_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Scott Ribe
In reply to this post by Aaron Boxer
On Jul 1, 2017, at 10:24 AM, Aaron Boxer <[hidden email]> wrote:
>
> On Sat, Jul 1, 2017 at 12:06 PM, scott ribe <[hidden email]> wrote:
> Why not create a temporary file?
>
> Yes,that could work. You mean in /dev/shm   ?

Not really, I meant just use a file, anywhere you want, likely in /tmp.

--
Scott Ribe
[hidden email]
(303) 722-0567

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read tiff file piped from stdout ?

Bob Friesenhahn
In reply to this post by Aaron Boxer
On Sat, 1 Jul 2017, Aaron Boxer wrote:

> On Sat, Jul 1, 2017 at 12:06 PM, scott ribe <[hidden email]>
> wrote:
>
>> Why not create a temporary file?
>
> I guess the downside is increased memory usage.

TIFF is a random-access format which requires seeking.  A carefully
prepared TIFF could minimize or even eliminate backward seeking but
you likely have no control over the TIFF files used.

You will always need to buffer the TIFF somewhere in order to assure a
sucessful read given normal TIFF files.

Bob
--
Bob Friesenhahn
[hidden email], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Loading...