Mogrify TIFF - Too many exceptions

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
tblaney
Posts: 4
Joined: 2017-07-03T12:10:28-07:00
Authentication code: 1151

Mogrify TIFF - Too many exceptions

Post by tblaney »

I have a script that I run on a window VM runs through a directory and combines 2 TIFF images into 1. Basically, its the front and back of a document and creates 1 file. I have since install Imagemagick on my Mac OS Sierra 10.12.5. When I run this same command, it makes it 50% of the way through the directory then fails with "Mogrify: too many exceptions" (exceptions processing suspended)":

Code: Select all

mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: Unknown field with tag 292 (0x124) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/915.
mogrify: incorrect count for field "PageNumber", expected 2, got 1. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/915.
mogrify: too many exceptions (exception processing suspended).
All the information returned are warnings only. Here is the command that I am running:

Code: Select all

mogrify -append -quality 100 -path ./PNGs/ -format png *.tiff
I have run "-quite" on the command as well, it still stops processing. There are about 4,000 files in the directory.

Is there a way to have it continue on a warning?

Other info:
LIBTIFF version 4.0.8
ersion: ImageMagick 6.9.8-10 Q16 x86_64 2017-07-03 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify TIFF - Too many exceptions

Post by fmw42 »

These are all warnings and mogrify should not stop. To exclude the warnings try adding -quiet to the command. But I do not think that you want to try to append all your tiff images in mogrify. That does not work. Mogrify makes one output for each input. So you are converting each tiff to a png. Also -quality 100 may not be what you want for PNG. It is not the same as for JPG. See http://www.imagemagick.org/script/comma ... hp#quality

Are your tiffs multi-layer or single layer?

If single layer, then remove the -append and you will get one PNG per TIFF

Code: Select all

mogrify -path ./PNGs/ -format png -quiet -quality XX *.tiff
If multilayer or multipage tiff and you want to append all the layers, then try

Code: Select all

mogrify -path ./PNGs/ -format png -quiet +adjoin -append -quality XX *.tiff
see http://www.imagemagick.org/script/comma ... php#adjoin
tblaney
Posts: 4
Joined: 2017-07-03T12:10:28-07:00
Authentication code: 1151

Re: Mogrify TIFF - Too many exceptions

Post by tblaney »

Thanks for the response FMW42

I reran with the following command:

Code: Select all

mogrify -append -path ./PNGs/ -format png *.tiff -quite
I removed the quality and used the default.
I need the append in, it produces 1 file out of the TIFF. If left out it creates 2 since the output is a PNG.

The result was the same,

Code: Select all

mogrify: too many exceptions (exception processing suspended).
here is the Tiffutil -dump of one of the files:

Code: Select all

TIFF Directory at offset 0x8 (8)
  Subfile Type: (0 = 0x0)
  Image Width: 1684 Image Length: 731
  Resolution: 200, 200 pixels/inch
  Bits/Sample: 1
  Compression Scheme: CCITT Group 4
  Photometric Interpretation: min-is-white
  FillOrder: msb-to-lsb
  Rows/Strip: 731
  Planar Configuration: single image plane
  Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x1d04 (7428)
  Subfile Type: (0 = 0x0)
  Image Width: 1699 Image Length: 730
  Resolution: 200, 200 pixels/inch
  Bits/Sample: 1
  Compression Scheme: CCITT Group 4
  Photometric Interpretation: min-is-white
  FillOrder: msb-to-lsb
  Rows/Strip: 730
  Planar Configuration: single image plane
  Group 4 Options: (0 = 0x0)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify TIFF - Too many exceptions

Post by fmw42 »

try this as I said above

Code: Select all

mogrify -path ./PNGs/ -format png -quiet +adjoin -append -quality XX *.tiff
See XX as desired for PNG compression.
tblaney
Posts: 4
Joined: 2017-07-03T12:10:28-07:00
Authentication code: 1151

Re: Mogrify TIFF - Too many exceptions

Post by tblaney »

I tried it, I should have mentioned that. There is something wrong with Adjoin Command:

Code: Select all

mogrify: unrecognized option `+adjoin' @ error/mogrify.c/MogrifyImageCommand/4106.
tblaney
Posts: 4
Joined: 2017-07-03T12:10:28-07:00
Authentication code: 1151

Re: Mogrify TIFF - Too many exceptions

Post by tblaney »

+adjoin is not really what I want. I want both pages to be in the same PNG. The original command string works when I run on a windows OS system. The newly installed Mac OS version is failing.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify TIFF - Too many exceptions

Post by fmw42 »

I suppose mogrify does not understand +adjoin. But I am confused where you get two tiff images. Are there two pages or two layers to your tiff files?

You same command should work on the Mac if your directories are used correctly. Did you cd to your input directory first? Is there a directory at the same level called "PNGs". Did you try to remove the trailing / from ./PNGs/ to be ./PNGs.

If this does not work, then please upload a couple of your TIFF files to some free hosting service and put the URLs here. That way we can test with your tiff files.
Post Reply