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 Answers2

3

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

infixed
  • 819
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
infixed
  • 819