[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Openexr-devel] Re: Unable to write single black pixel image
From: |
Florian Kainz |
Subject: |
[Openexr-devel] Re: Unable to write single black pixel image |
Date: |
Thu, 19 Feb 2004 17:57:57 -0800 |
Charles Henrich wrote:
>
> In version 1.0.7 under linux if you try and write a single black pixel with
> either zlib compression methods, you the library will fail with:
>
> Failed to write pixel data to image file "/tmp/test.exr". Data compression
> (zlib) failed.
>
> Is this a known issue with 1.0.7?
>
> -Crh
>
For very small images, class ZipCompressor in version 1.0.7
sometimes allocates a buffer for the compressed pixels that
is too small, and zlib compression fails. This has been fixed
in version 1.1.0. (I tried writing a single black pixel with
ZIP and ZIPS compression, and it worked.)
You can patch file ImfZipCompressor.cpp if you don't want to
switch to OpenEXR 1.1.0. Change line 62,
_outBuffer = new char [maxScanLineSize * numScanLines * 3 / 2];
to
_outBuffer = new char [maxScanLineSize * numScanLines * 3 / 2 + 100];
and line 141,
uLongf outSize = inSize * 3 / 2;
to
uLongf outSize = inSize * 3 / 2 + 100;