dk / Prima

prima.eu.org
Other
106 stars 27 forks source link

t/Image/Stream.t test fails on TIFF #104

Closed wurtel2 closed 6 months ago

wurtel2 commented 6 months ago

#   Failed test 'TIFF'
#   at t/Image/Stream.t line 76.
# Looks like you failed 1 test of 15.
t/Image/Stream.t ....... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/15 subtests 
    (less 1 skipped subtest: 13 okay)

I'm using Debian 12, library versions:

ii  libfribidi-dev:amd64  1.0.13-3         
ii  libgif-dev:amd64      5.2.1-2.5        
ii  libgtk-3-dev:amd64    3.24.39-1        
ii  libharfbuzz-dev:amd64 8.0.1-1          
ii  libheif-dev:amd64     1.17.6-1         
ii  libjpeg-dev:amd64     1:2.1.5-2        
ii  libthai-dev:amd64     0.1.29-1         
ii  libtiff-dev:amd64     4.5.1+git230720-3
ii  libwebp-dev:amd64     1.3.2-0.3        
ii  libxpm-dev:amd64      1:3.5.17-1       

Perl version 5.36.0-10

Compilation seems to go fine, no relevant warnings AFAICS. If I remove the img/codec_tiff.c source file and rebuild, all tests succeed.

Any hints how to fix this?

dk commented 6 months ago

That libtiff version 4.5.1+git230720-3 is a bit suspicious, is that a standard rpm debian installs after 'apt-get dist-upgrade'? The loading error is very specific, it means that the file to be loaded doesn't have the tiff signature, i e first 4 bytes are not 'TIFF' or whatever that signature is... This suggests that the file was corrupted or saved badly. Will try to reproduce, but could you try something along the lines of 'convert test.jpg test.tiff' (the convert tool is from imagemagick) to see if the resulting tiff file is okay?

wurtel2 commented 6 months ago

It appears that that libtiff-dev version is from Debian testing. I'll downgrade to the official Debian 12 version tomorrow and try again. Note that this is from the "make test" part of the install, so any test.tiff would be from the tar.gz; however I don't see that in the tar.gz.

dk commented 6 months ago

the test is both for saving and loading images, so that test.tiff is generated by Prima/libtiff, that's why you don't see it

wurtel2 commented 6 months ago

I've downgraded to libtiff-dev:amd64 4.5.0-6+deb12u1 and now it works. I've strace'd both versions of the test, the writing of the TIFF file is identical in both, reading it back begins the same then does some lseeks differently and then fails.

Thanks for the hint in the direction of the libtiff library, I can now proceed to play with Prima.

Hopefully the issues in libtiff are resolved before being definitely released.