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

IFF doesn't accept scanlines and has only one tile size #794

Closed
lgritz opened this issue Jan 28, 2014 · 7 comments · Fixed by #804
Closed

IFF doesn't accept scanlines and has only one tile size #794

lgritz opened this issue Jan 28, 2014 · 7 comments · Fixed by #804
Labels
file formats Image file formats, ImageInput, ImageOutput

Comments

@lgritz
Copy link
Collaborator

lgritz commented Jan 28, 2014

Glancing at the IFF writer, I noticed that it doesn't accept scanlines and has only one tile size, and doesn't properly give errors if opened with a request for scanlines or for the wrong tile size. This would be really confusing to anybody trying to write an iff file. All other writers accept scanlines, and we don't even have a "supports()" query for whether an writer accepts scanlines. IFF needs to do so as well, even if it just means that it buffers the whole image until a whole row of scanlines has been sent and then outputs the tiles contained therein.

Very low priority, probably nobody is writing iff files, only reading them. I'm entering this issue mainly so that somebody remembers to go back and fix it later.

@mjmvisser
Copy link
Contributor

Ha, I just ran into this exact problem. Unless you pass "--tiles", oiiotool crashes with a floating point exception. I actually got a request to generate image planes for Maya in IFF, as it's apparently the only format Maya can read at a reasonable speed.

@lgritz
Copy link
Collaborator Author

lgritz commented Feb 14, 2014

Potential fix under review, Mark: #804.

@mjmvisser
Copy link
Contributor

Still crashes on latest master without --tile 64 64 (try something like "oiiotool somefile.png -o foo.iff"). Here's a stack trace:

Program received signal SIGFPE, Arithmetic exception.
0x00007ffff783ce62 in OpenImageIO::v1_4::ImageSpec::valid_tile_range (this=0x7062c8, xbegin=0, xend=2008, ybegin=0, yend=64, zbegin=0, zend=0) at /home/mvisser/workspace/oiio/src/include/imageio.h:355
355                     (((zend-z) % tile_depth)  == 0 || (zend-z) == depth));
Missing separate debuginfos, use: debuginfo-install freetype-2.3.11-14.el6_3.1.x86_64 glibc-2.12-1.132.el6.x86_64 keyutils-libs-1.4-4.el6.x86_64 krb5-libs-1.10.3-10.el6_4.6.x86_64 libcom_err-1.41.12-18.el6.x86_64 libgcc-4.4.7-4.el6.x86_64 libicu-4.2.1-9.1.el6_2.x86_64 libjpeg-turbo-1.2.1-3.el6_5.x86_64 libpng-1.2.49-1.el6_2.x86_64 libselinux-2.0.94-5.3.el6_4.1.x86_64 libstdc++-4.4.7-4.el6.x86_64 openjpeg-libs-1.3-10.el6_5.x86_64 openssl-1.0.1e-16.el6_5.4.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) where
#0  0x00007ffff783ce62 in OpenImageIO::v1_4::ImageSpec::valid_tile_range (this=0x7062c8, xbegin=0, xend=2008, ybegin=0, yend=64, zbegin=0, zend=0) at /home/mvisser/workspace/oiio/src/include/imageio.h:355
#1  0x00007ffff7858a84 in OpenImageIO::v1_4::ImageOutput::write_tiles (this=0x7062c0, xbegin=0, xend=2008, ybegin=0, yend=64, zbegin=0, zend=0, format=..., data=0x7fffec6c9010, xstride=12, ystride=24096,
    zstride=25927296) at /home/mvisser/workspace/oiio/src/libOpenImageIO/imageoutput.cpp:104
#2  0x00007ffff785a556 in OpenImageIO::v1_4::ImageOutput::write_image (this=0x7062c0, format=..., data=0x7fffec6c9010, xstride=12, ystride=24096, zstride=25927296, progress_callback=0,
    progress_callback_data=0x0) at /home/mvisser/workspace/oiio/src/libOpenImageIO/imageoutput.cpp:443
#3  0x00007ffff7806496 in OpenImageIO::v1_4::ImageBuf::write (this=0x7065f0, out=0x7062c0, progress_callback=0, progress_callback_data=0x0)
    at /home/mvisser/workspace/oiio/src/libOpenImageIO/imagebuf.cpp:902
#4  0x0000000000462743 in output_file (argc=2, argv=0x7fffffff8048) at /home/mvisser/workspace/oiio/src/oiiotool/oiiotool.cpp:559
#5  0x00007ffff7af1800 in OpenImageIO::v1_4::ArgOption::invoke_callback (this=0x711590, argc=2, argv=0x7fffffff8048) at /home/mvisser/workspace/oiio/src/libutil/argparse.cpp:80
#6  0x00007ffff7af086c in OpenImageIO::v1_4::ArgParse::parse (this=0x7fffffff7c80, xargc=4, xargv=0x7fffffff8038) at /home/mvisser/workspace/oiio/src/libutil/argparse.cpp:383
#7  0x000000000047f82e in getargs (argc=4, argv=0x7fffffff8038) at /home/mvisser/workspace/oiio/src/oiiotool/oiiotool.cpp:3448
#8  0x0000000000481329 in main (argc=4, argv=0x7fffffff8038) at /home/mvisser/workspace/oiio/src/oiiotool/oiiotool.cpp:3687

@lgritz
Copy link
Collaborator Author

lgritz commented Feb 19, 2014

Are you quite sure? When I try, 'oiiotool ../oiio-images/tahoe-gps.jpg -o test.iff' gets the crash in master, but not in the lg-iff branch that I've submitted for code review.

Which platform? Can you send me a specific command line and input file that crashes (some file inside testsuite, or oiio-images, for example)?

@lgritz
Copy link
Collaborator Author

lgritz commented Feb 19, 2014

Oh, I see now, you said "on latest master."

Right, Mark, I have not yet merged the proposed fix.

Can you try the lg-iff branch from the pull request and see if it is ok for you?

@mjmvisser
Copy link
Contributor

Ah, sorry, I should have read that a bit more carefully. All good with lg-iff, no more crashes.

@lgritz
Copy link
Collaborator Author

lgritz commented Feb 20, 2014

OK, merged into master now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file formats Image file formats, ImageInput, ImageOutput
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants