Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maketx for single channel dwaa #1844

Closed
ThiagoIze opened this issue Jan 17, 2018 · 2 comments
Closed

maketx for single channel dwaa #1844

ThiagoIze opened this issue Jan 17, 2018 · 2 comments

Comments

@ThiagoIze
Copy link
Collaborator

When running maketx on a single channel image and specifying exr dwaa output, I get a fail.

To repro (tested on latest master):

% oiiotool --pattern checker 512x512 1 -o test.jpg
% maketx --format exr --compression dwaa test.jpg
maketx ERROR writing "test.8d714779.temp.tx" : Failed OpenEXR write: Failed to write pixel data to image file "test.8d714779.temp.tx". Data compression (zlib) failed.

But, if I create the dwaa exr directly through oiiotool then it seems to work:

% oiiotool --pattern checker 512x512 1 --compression dwaa -o test.exr
% iinfo -v test.exr
test.exr :  512 x  512, 1 channel, float openexr
    channel list: Y
    oiio:ColorSpace: "Linear"
    compression: "dwaa"
...
@lgritz
Copy link
Collaborator

lgritz commented Nov 21, 2018

Accept another apology from me for letting this issue fall through the cracks.

After some investigation, it seems that any attempt to write tiled exr with dwaa compression will hit this error if the tile size is < 16x16.

In your original example, the reason it failed for maketx but not the oiiotool command is that the maketx, in writing the MIP levels, eventually gets down to 8x8 resolution and that tile size fails.

Here's an even simpler repro case that doesn't involve MIP maps:

# works
oiiotool --pattern checker 512x512 1 -d half -compression dwaa -tile 16 16 -o test.exr

# fails
oiiotool --pattern checker 512x512 1 -d half -compression dwaa -tile 8 8 -o test.exr

Sure seems like an OpenEXR internals bug. I will report to them, I don't think there's much I can do on my side.

@lgritz
Copy link
Collaborator

lgritz commented Jan 15, 2019

Closing. Fixed by #2147.

@lgritz lgritz closed this as completed Jan 15, 2019
lgritz added a commit to lgritz/OpenImageIO that referenced this issue Jun 14, 2023
PR AcademySoftwareFoundation#2147, addressing issue AcademySoftwareFoundation#1844, is related to an apparent OpenEXR
bug wherein single channel tiled images where the tile dimensions were
not a power of 2 and >= 16 would not work properly with dwa
compression. We work around the problem by automatically substituting
zip compression in those cases. But it was implemented with a subtle
bug, forgetting that tile_size == 0 for untiled images, and thus we
were silently switching from dwa to zip compression for all *untiled*
single channel images of any size (which presumably were never
problematic). This patch fixes the test so we are not changing the
compression for the untiled files.

There's a long

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit that referenced this issue Jun 14, 2023
PR #2147, addressing issue #1844, is related to an apparent OpenEXR bug
wherein single channel tiled images where the tile dimensions were not a
power of 2 and >= 16 would not work properly with dwa compression. We
work around the problem by automatically substituting zip compression in
those cases. But it was implemented with a subtle bug, forgetting that
tile_size == 0 for untiled images, and thus we were silently switching
from dwa to zip compression for all *untiled* single channel images of
any size (which presumably were never problematic). This patch fixes the
test so we are not changing the compression for the untiled files.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
lgritz added a commit to lgritz/OpenImageIO that referenced this issue Jun 14, 2023
…demySoftwareFoundation#3884)

PR AcademySoftwareFoundation#2147, addressing issue AcademySoftwareFoundation#1844, is related to an apparent OpenEXR bug
wherein single channel tiled images where the tile dimensions were not a
power of 2 and >= 16 would not work properly with dwa compression. We
work around the problem by automatically substituting zip compression in
those cases. But it was implemented with a subtle bug, forgetting that
tile_size == 0 for untiled images, and thus we were silently switching
from dwa to zip compression for all *untiled* single channel images of
any size (which presumably were never problematic). This patch fixes the
test so we are not changing the compression for the untiled files.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants