2011.09.01 11:45 "[Tiff] test.tiff: Error, can't allocate space for image buffer.", by Mathieu Malaterre

2011.09.01 15:51 "Re: [Tiff] test.tiff: Error, can't allocate space for image buffer.", by ademmler

Dear David,

thanks for your replay. I am confused know, because I have send my input and output file from testing tiffcp.

Where did you got those tiffinfos from, they differ from mine. My problem is, that tiffcp is destroying my tiffs. Not to open the in.tiff, which I can open with PSD. Also in your tiffinfos you have RGB/JPEG.

My files need to stay greyscale with ZIP compression.

tiffcp -c zip in.tif out.tif is the propper cmdline.

Regardsa Alexander

Am 01.09.2011 um 15:24 schrieb David Burken:

On 09/01/2011 07:45 AM, Mathieu Malaterre wrote:

Dear all,

I am trying to extract the first image of a multiframes TIFF image. According to tiffcp documentation one should use:

$ tiffcp test.tiff,0 out.tiff

However it keeps on failing with:

test.tiff: Error, can't allocate space for image buffer.

The first image is: 110400 x 75134 x 3 = 24,884,380,800

The second must be 1024 x 696 that's why it works.

So it doesn't surprise me the space error. I don't know the guts of tiffcp but you need to use and app that is tile based for an image that size. In other words, one that doesn't try to load the whole image in memory. The tiff apps may be able to do that I'm not sure. OSSIM or GDAL apps can do for sure. Here's one that I know for sure can do:

http://trac.osgeo.org/ossim/wiki/icp

Note for an image that size you should always make the output image tiled for readers...

Hope that helps,

The strangest thing is that it works with the next image:

$ tiffcp test.tiff,1 out.tiff
$ tiffinfo out.tiff

TIFF Directory at offset 0x1ddbe (122302)
    Subfile Type: (0 = 0x0)
    Image Width: 1024 Image Length: 696
    Bits/Sample: 8
    Compression Scheme: JPEG
    Photometric Interpretation: YCbCr
    Orientation: row 0 top, col 0 lhs
    Samples/Pixel: 3
    Rows/Strip: 16
    Planar Configuration: single image plane

  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255

ImageDescription: Aperio ImageComp v8.0.22 110400x75134 -> 1024x696 - |AppMag = 40|StripeWidth = 2034|ScanScope ID = SS1203|Filename = 11161|Title = none|Date = 02/14/07|Time =

>> 00:39:27|User = f3e05499-1e13-49ce-add0-de1c3c85e6da|MPP = 0.2544|
>> Left
>> = 18.847906|Top = 19.581955|LineCameraSkew = -0.000865|
>> LineAreaXOffset

= 0.035360|LineAreaYOffset = -0.004219|DSR ID = hooke|ImageID = 11161|OriginalWidth = 115000|Originalheight = 75284|Filtered = 3

JPEG Tables: (574 bytes)

Here is the output of tiffinfo of my input image:

...
TIFF Directory at offset 0x62f99276 (1660523126)
  Subfile Type: (0 = 0x0)
  Image Width: 110400 Image Length: 75134 Image Depth: 1
  Tile Width: 240 Tile Length: 240
  Bits/Sample: 8
  Compression Scheme: 33003 (0x80eb)
  Photometric Interpretation: RGB color
  Samples/Pixel: 3
  Planar Configuration: single image plane

ImageDescription: Aperio Image Library v8.0.22 115000x75284 [0,150 110400x75134] (240x240) J2K/MIL Q=70|AppMag = 40|StripeWidth = 2034|ScanScope ID = SS1203|Filename = 11161|Title = none|Date = 02/14/07|Time = 00:39:27|User =

>> f3e05499-1e13-49ce-add0-de1c3c85e6da|MPP = 0.2544|Left = 18.847906|
>> Top

= 19.581955|LineCameraSkew = -0.000865|LineAreaXOffset = 0.035360|LineAreaYOffset = -0.004219|DSR ID = hooke|ImageID = 11161|OriginalWidth = 115000|Originalheight = 75284|Filtered = 3

...

I am using libtiff 3.9.5 and 4.0.0~beta7 on a Linux/debian machine.

Thanks for suggestions,