Sorry, can not handle images with 32-bit samples

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ITWarrior
Posts: 3
Joined: 2019-05-18T01:03:33-07:00
Authentication code: 1152

Sorry, can not handle images with 32-bit samples

Post by ITWarrior »

Hi folks,

I'm having a hard time working with tiffs in ImageMagick. This is my first time properly using ImageMagick. The error I'm getting is "Sorry, can not handle images with 32-bit samples". I have Googled this, and found that the version I was using (CentOS 7 EPEL) was compiled with Q16:

Code: Select all

# /usr/bin/convert -list configure | grep 'quantum\|DELEGATES'
DELEGATES     bzlib fontconfig freetype gs jpeg jng jp2 lzma openexr pango png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro ' --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-dps=no --with-fontpath= --with-gvc=no
I downloaded and compiled the latest ImageMagick from the site today, and compiled it with the flags I needed:

Code: Select all

./configure --with-quantum-depth=32 --enable-hdri --with-jpeg=yes --with-png=yes --with-tiff=yes --with-zlib=yes
Which produces (note the new quantum-depth):

Code: Select all

# /usr/local/bin/convert -list configure | grep 'quantum\|DELEGATES'
CONFIGURE             ./configure  '--with-quantum-depth=32' '--enable-hdri' '--with-jpeg=yes' '--with-png=yes' '--with-tiff=yes' '--with-zlib=yes'
DELEGATES             mpeg openjp2 png ps tiff zlib
DISTCHECK_CONFIG_FLAGS  --disable-deprecated  --with-quantum-depth=32  --with-jemalloc=no  --with-umem=no  --with-autotrace=no  --with-gslib=no  --with-fontpath=  --with-rsvg=no  --with-perl=no 
DELEGATES             jp2 png tiff zlib
But when I try the original conversion again, I get the same error. I'm at a total loss of what might be going on. Has anybody seen this before?:

Code: Select all

# /usr/local/bin/convert dsm.tif out.png
convert: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Unknown field with tag 42112 (0xa480) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Unknown field with tag 42113 (0xa481) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/995.
convert: Sorry, can not handle images with 32-bit samples. `dsm.tif' @ error/tiff.c/TIFFErrors/656.
#
Thanks a lot for any help.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Sorry, can not handle images with 32-bit samples

Post by snibgo »

I've never seen that message before.

What was your command? Please link to a sample input file so we can test it doesn't have problems.

What version of IM ("magick -version")? What version of the TIFF library("magick -list format |grep TIFF")?

If your TIFF library is older than v4.0.9 I suggest you upgrade it, rebuild IM and try again.

Note: IM built with a low quantum depth (eg Q16) can read files with higher depth (eg Q32), but will discard precision before storing the image in memory.
snibgo's IM pages: im.snibgo.com
ITWarrior
Posts: 3
Joined: 2019-05-18T01:03:33-07:00
Authentication code: 1152

Re: Sorry, can not handle images with 32-bit samples

Post by ITWarrior »

Thanks for the reply. The command was in the original message though disguised in the noise:

/usr/local/bin/convert dsm.tif out.png

Input file: https://dev.aerosurvey.co.nz/files/242/dsm.tif

Versions:

Code: Select all

[root@dev 242]# magick -version
Version: ImageMagick 7.0.8-45 Q32 x86_64 2019-05-18 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC OpenMP(3.1) 
Delegates (built-in): jp2 png tiff zlib

[root@dev 242]# magick -list format |grep TIFF
      EPT  rw-   Encapsulated PostScript with TIFF preview
     EPT2  rw-   Encapsulated PostScript Level II with TIFF preview
     EPT3  rw+   Encapsulated PostScript Level III with TIFF preview
     PTIF* rw+   Pyramid encoded TIFF
     TIFF* rw+   Tagged Image File Format (LIBTIFF, Version 4.0.3)
   TIFF64* rw-   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
GraphicsMagick (1.3.31 2018-11-17 Q16) works with the same file, so I'm a bit perplexed. Bug with ImageMagick perhaps?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Sorry, can not handle images with 32-bit samples

Post by snibgo »

Your LIBTIFF is slightly older than the version currently used by IM. However, that doesn't seem to be the problem. I don't have a version of IM that can read your file dsm.tiff. For example, with IM v7.0.7-28 Q32 with HDRI, ignoring "Unknown field" warnings:

Code: Select all

magick identify -verbose dsm.tiff

identify: Sorry, can not handle images with 32-bit samples. `dsm.tiff' @ error/tiff.c/TIFFErrors/650.
With v6.9.9-40 Q32 HDRI:

Code: Select all

f:\web\im>identify -verbose dsm.tiff

identify: improper image header `dsm.tiff' @ error/tiff.c/ReadTIFFImage/1597.
Gimp v2.10 and Microsoft Photo Viewer can both open the file. Gimp says it is 32-bit/channel floating point. IM can successfully read/write 32-bit FP tiff files.

I'll defer to the developers.
snibgo's IM pages: im.snibgo.com
246246
Posts: 190
Joined: 2015-07-06T07:38:22-07:00
Authentication code: 1151

Re: Sorry, can not handle images with 32-bit samples

Post by 246246 »

It looks ImageMagick failed to read 16 bit float and 32 bit float tiff file when it is encoded in tile format.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Sorry, can not handle images with 32-bit samples

Post by magick »

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.
Post Reply