12

I process ETOPO1.tif into a cropped area hillshade.

I get a tiff image looking like :enter image description here

When I process it via ImageMagick, it runs successfully. But I get the following set of warning messages:

convert Yug-shadedrelief.tmp.tif -fuzz 7% -fill "#FFFFFF" -opaque "#DDDDDD"  whited.jpg     # lighter (0.9M)

 convert.im6: Unknown field with tag 33550 (0x830e) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
 convert.im6: Unknown field with tag 33922 (0x8482) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
 convert.im6: Unknown field with tag 34735 (0x87af) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
 convert.im6: Unknown field with tag 34736 (0x87b0) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
 convert.im6: Unknown field with tag 34737 (0x87b1) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.
 convert.im6: Unknown field with tag 42113 (0xa481) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/768.

Is my .tif corrupted ?

What can I do to take this messages out ?

Mike 'Pomax' Kamermans
  • 49,297
  • 16
  • 112
  • 153
Hugolpz
  • 17,296
  • 26
  • 100
  • 187
  • 4
    Not corrupted - it looks like whatever program generated the image used some custom TIFF tags that ImageMagick doesn't recognise. I would discard them with `convert x.tiff ... 2> /dev/null` or, if you are on Windows `convert -quiet x.tiff ...` – Mark Setchell Dec 22 '14 at 19:23
  • I used GIS script tool `gdal` to generate the input file of this question. – Hugolpz Dec 22 '14 at 20:56

3 Answers3

16

Unlike your original headline said (which I changed), this is not an 'error' message, but merely a warning:

TIFFReadDirectory: Warning, Unknown field with tag 33550 (0x830e) encountered. [...]
TIFFReadDirectory: Warning, Unknown field with tag 33922 (0x8482) encountered. [...]
TIFFReadDirectory: Warning, Unknown field with tag 34735 (0x87af) encountered. [...]
[...]

The tags listed here are private tags of GeoTIFF. See here:

To look at their (probably not very meaningful to you) content, you can use the tiffdump (or tiffutil -dump) utility. There is a chance that exiftool can show you the meanings of these tags:

 exiftool -a -U -u -g1 Yug-Shadedrelief.tmp.tif

The -u and -U should extract also all unknown (to exiftool) tags. If you don't have "garbage" in your output, exiftool was able to make heads and tails from what it saw, and so should you :-)

Maybe it is an option to you to releaseremove these tags? exiftool can also do that for you...

If you only want to get the annoying messages out of your eyesight, and not change your TIFFs, then a 2> /dev/null redirection of stderr for your commands would suffice:

convert                    \
  Yug-shadedrelief.tmp.tif \
 -fuzz 7%                  \
 -fill "#FFFFFF"           \
 -opaque "#DDDDDD"         \
  whited.jpg               \
  2>/dev/null

Update

 Code |  Code |                     |
(dec) | (hex) | Tag Name            | Short Description
------+-------+---------------------+--------------------------------------------------------
33550 | 830E  | ModelPixelScaleTag  | Used in interchangeable GeoTIFF files
33922 | 8482  | ModelTiepointTag    | Originally part of Intergraph's GeoTIFF, 
34735 | 87af  | GeoKeyDirectoryTag  | Used in interchangeable GeoTIFF files
34736 | 87b0  | GeoDoubleParamsTag  | Used in interchangeable GeoTIFF files
34737 | 87b1  | GeoAsciiParamsTag   | Used in interchangeable GeoTIFF files
42113 | a481  | GDAL_NODATA         | Used by GDAL lib, contains ASCII encoded nodata or ...

Explanations:

  • 33550: "...optionally provided for defining exact affine transformations between raster and model space...."
  • 33922: "...also known as 'GeoreferenceTag'. This tag stores raster->model tiepoint pairs..."
  • 34735: "...also known as 'ProjectionInfoTag' and 'CoordSystemInfoTag'"
  • 34736: "...used to store all of the DOUBLE valued GeoKeys, referenced by the GeoKeyDirectoryTag..."
  • 34737: "...used to store all of the ASCII valued GeoKeys, referenced by the GeoKeyDirectoryTag"
  • 42113: "...a special pixel value to mark geospatial areas for which no info is available..."
Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
  • Thanks Kurt. I updated the content of the question with 'warning' as well, I will explore your info tomorrow morning. – Hugolpz Dec 22 '14 at 20:58
  • I stumbled upon this question as I have issues with my `libtiff` version who seems to be having similar problems. In order to understand what is going on I have tried to find `exiftool`, `tiffdump` and `tiffutil`. Unfortunately I have only found `exiftool` on the SourceForge website but it does not give the information I'm looking for. Can anybody tell me where I can download `tiffdump` and/or `tiffutil` from? – Dominique May 10 '16 at 09:50
  • @Dominique: `tiffdump` is part of the standard `tiff` or `libtiff` package. `tiffutil` is part of Mac OS X, with its code based on `tiffcp` and `tiffinfo` from the `libtiff/tiff` package. – Kurt Pfeifle May 10 '16 at 11:00
  • @Dominique: *tiff/libtiff* are available for Windows (AFAIR also as part of the gnuwin32/tiff package on SourceForge), and with it `tiffinfo` and `tiffdump`. – Kurt Pfeifle May 10 '16 at 11:56
  • Note that this answer lacks the one thing that actually solves the "problem" of imagemagik outputting warnings, which is adding the `-quiet` flag that's mentioned in a comment. These files don't need any sort of tag stripping, they are perfectly valid TIFF files, and would in fact become _invalid_ GeoTIFF files if you removed them. There are no actual problems to solve here, only output to suppress if you don't want it cluttering up your log. – Mike 'Pomax' Kamermans Jun 21 '23 at 00:31
5

Is my .tif corrupted?

No, those are just warnings about additional metadata (private TIFF tags) that Imagemagick does not know.

What can I do to take this messages out?

Add the command line option -quiet to suppress all warning messages (as suggested by Mark Setchell in a comment).

Robert Pollak
  • 3,751
  • 4
  • 30
  • 54
0

You can recompile libtiff by :

  • adding in tiff.h these kind of line

    #define TIFFTAG_ModelPixelScale 33550

  • adding in TIFFFieldInfo in tif_dirinfo.c

    static const TIFFFieldInfo; tiffFieldInfo[] = {..., { TIFFTAG_ModelPixelScale,1, 1, TIFF_LONG, FIELD_SUBFILETYPE, 1, 0, "ModelPixelScale" }, ... };