0

We have a process in which we crop a pdf image using Adobe Illustrator. During this process, thumbnail metadata is being added to the image. Later we convert the image to eps. The image looks fine till then. Then we convert the image to tiff using ImageMagick. During this stage, a thumbnail image is getting attached to the top left corner of the original image. Is there a way to remove this thumbnail image?

Shiny S U
  • 43
  • 2
  • 5

2 Answers2

3

There are a number of possibilities, depending on what's actually happening and it is hard to tell without seeing your input and output files at each stage along with your actual processing.


Sometimes thumbnails are the first entry in a TIFF, so you might choose to only load from the second entry (counting from zero) onwards in a TIFF onwards:

magick input.tif[1--1] ...

If you can't avoid loading the first/last entry, you could load everything and delete whatever you don't want afterwards. So, if I check an image like this, I will see it has 6 scenes, viz. 0 through 5:

magick identify image.tif
image.tif[0] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 283124B 0.000u 0:00.000
image.tif[1] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[2] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[3] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[4] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000
image.tif[5] TIFF 2448x3168 2448x3168+0+0 1-bit Bilevel Gray 0.010u 0:00.000

If I want to delete the first and last entry, before processing the remaining entries, I can do:

magick image.tif -delete 0,-1  -format "Processing scene: %s Resolution: %G\n" -write info: <FURTHER PROCESSING OF EACH PAGE> result-%d.png

Sample Output

magick image.tif -delete 0,-1  -format "Processing scene: %s Resolution: %G\n" -write info: -crop 10x10+0+0 result-%d.png
Processing scene: 1 Resolution: 2448x3168
Processing scene: 2 Resolution: 2448x3168
Processing scene: 3 Resolution: 2448x3168
Processing scene: 4 Resolution: 2448x3168

You can work out if this is the case by examining your image with:

  • exiftool YOURIMAGE and looking for "Subfile Type: Single page of multi-page image"
  • tiffinfo YOURIMAGE and looking for number of entries
  • magick identify YOUIRIMAGE and looking for more than one line of output

Sometimes thumbnails are in the metadata, so you can try stripping these with one of the following:

magick INPUT.JPG -strip RESULT.JPG
jhead -dt YOURIMAGE
exiftool -thumbnailimage= YOURIMAGE

You can also find these with:

  • exiftool YOURIMAGE and looking for embedded binary data
  • magick identify -verbose YOURIMAGE
  • jhead YOURIMAGE
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
0

You can try the below solution:

exiftool -ifd1:all= -m Your_file_name

This is what really helped us.

Sajjad Manal
  • 371
  • 4
  • 25
Shiny S U
  • 43
  • 2
  • 5