1

I was at the library scanning pages of old newspaper articles and the microfilm scanner generated a TIFF stack. Now I am back home I thought this was going to be easier but nothing sees past frame zero. Is there a way to use convert from command line to separate all the images? Just running convert crashes.

jonathan@weinraub:~$ convert nyt_1980_12_30.tif nyt%d.png
Killed

2016-03-11T09:32:32-05:00 0:04.850 4.420u 6.8.9 Resource convert[1699]: resource.c/AcquireMagickResource/279/Resource Area: 119MB/119MB/4.2005GB 2016-03-11T09:32:32-05:00 0:04.850 4.420u 6.8.9 Resource convert[1699]: resource.c/AcquireMagickResource/279/Resource Memory: 119MB/1.1085GiB/1.956GiB 2016-03-11T09:32:32-05:00 0:04.850 4.420u 6.8.9 Cache convert[1699]: cache.c/OpenPixelCache/3606/Cache open nyt_1980_12_30.tif[9] (Heap Memory, 3400x4376 113.5MiB) 2016-03-11T09:32:32-05:00 0:04.850 4.420u 6.8.9 Resource convert[1699]: resource.c/AcquireMagickResource/279/Resource Memory: 59.51MB/1.164GiB/1.956GiB 2016-03-11T09:32:32-05:00 0:04.850 4.420u 6.8.9 Exception convert[1699]: tiff.c/TIFFWarnings/861/Exception Depreciated and troublesome old-style JPEG compression mode, please convert to new-style JPEG compression and notify vendor of writing software. OJPEGSetupDecode' Killed

jonathan@weinraub:~$ which convert
/usr/bin/convert
jonathan@weinraub:~$ convert
Version: ImageMagick 6.8.9-9 Q16 x86_64 2015-01-05     http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl     lzma openexr pangocairo png tiff wmf x xml zlib

Usage: convert [options ...] file [ [options ...] file ...] [options ...] file

Whats interesting, I tried on my RHEL server and I got different errors and it failed:

update:

16:55:40 0:36 34.100u 6.2.8 Cache convert[27230]: cache.c/DestroyCacheInfo/1763/Cache destroy nyt_1980_12_30.tif[10] 16:55:40 0:36 34.120u 6.2.8 Resource convert[27230]: resource.c/RelinquishMagickResource/801/Resource Memory: 1.1e+02mb/1.1e+02mb/5.9gb 16:55:40 0:36 34.120u 6.2.8 Cache convert[27230]: cache.c/DestroyCacheInfo/1763/Cache destroy nyt_1980_12_30.tif[11] 16:55:40 0:36 34.150u 6.2.8 Resource convert[27230]: resource.c/RelinquishMagickResource/801/Resource Memory: 1.1e+02mb/0/5.9gb 16:55:40 0:36 34.150u 6.2.8 Cache convert[27230]: cache.c/DestroyCacheInfo/1763/Cache destroy nyt_1980_12_30.tif[12] convert: nyt_1980_12_30.tif: unknown field with tag 512 (0x200) encountered. TIFFReadDirectory'. convert: nyt_1980_12_30.tif: unknown field with tag 513 (0x201) encountered. TIFFReadDirectory'. convert: nyt_1980_12_30.tif: unknown field with tag 514 (0x202) encountered. TIFFReadDirectory'. convert: nyt_1980_12_30.tif: unknown field with tag 519 (0x207) encountered. TIFFReadDirectory'. convert: nyt_1980_12_30.tif: unknown field with tag 520 (0x208) encountered. TIFFReadDirectory'.

I used Ifranview in windows at work and i got it converted in the end. But, I like to know why now on two systems, debian and rhel, it is failing.

2

Assuming TIFF file is not splitable via imagemagick due to outdated jpeg format used as compression

Assuming a platform like Debian or Ubuntu

use the libtiff-tools package that supplies the utility tiffsplit

sudo apt-get install libtiff-tools
tiffsplit problematicfile.tif file

edit

JPEG is a kind of compression that TIFF supports. Imagemagick seems to have problems with it sometimes. if the split files are still problematic, then the compression can be altered with a different libtiff tool, tiffcpwhich can use one of several other compression types with its -c switch

tiffcp -c lzw jpegedfile.tif  lzwedfile.tif

promoted from the comments (@Mint)

Technote on why compression sometimes fails

5
  • Note on why old jpeg format was messed up remotesensing.org/libtiff/TIFFTechNote2.html – infixed Mar 12 '16 at 1:21
  • 1
    Unless I used it wrong, I got TIFFReadRawStrip: Compression scheme does not support access to raw uncompressed data. – Jonathan Weinraub Mar 12 '16 at 19:32
  • was that on the tiffsplit or tiffcp? tiffcp has a -c none switch. You could try that on the whole stack before splitting. Sounds like that jpeg compression was a bad idea for the programmer, even if they set it for lossless level of quality – infixed Mar 13 '16 at 6:17
  • That did the trick. Interestingly enough, using the tiffcp then the tiffsplit separated the file into 14 tiff files. using convert on the tiffscp only generated two PNGs before being killed – Jonathan Weinraub Mar 13 '16 at 6:51
  • 1
    For anyone looking to read the TIFFTechNote2.html page from the first comment, it's still up on the internet archive (as remotesensing.org has closed down) web.archive.org/web/20160303165607/http://www.remotesensing.org/… – Mint Aug 9 '19 at 8:22
0

See How to split a multipage TIFF file on Windows?

but use the convert to make PNGs instead

convert multipage.tif single%d.png
12
  • It still gets killed. I edited my original question to show. – Jonathan Weinraub Mar 11 '16 at 5:03
  • Maybe turning on debug logging will provide some insight convert -debug all nyt_1980_12_30.tif nyt%d.png – infixed Mar 11 '16 at 13:08
  • you might even verify that your path is such that running convert is imagemagick's convert. A verb like convert may be used by something else as a command name – infixed Mar 11 '16 at 13:12
  • Wow, if that's an abort on a depreciated feature of JPEG, that's pretty hash. – infixed Mar 11 '16 at 21:31
  • People were complaining about it here: imagemagick.org/discourse-server/viewtopic.php?f=3&t=16155 – infixed Mar 11 '16 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.