Am trying to run a simple .eps to .png conversion using image magic convert.exe,
IF EXIST test.eps convert.exe test.eps test.png
I see the error :
convert.exe: Invalid TIFF directory; tags are not sorted in ascending order. `TIFFReadDirectoryCheckOrder' # warning/tiff.c/TIFFWarnings/960.
I do not have TIFF image inside the folder nor am trying to convert TIFF image. Why am I seeing this error?
Related
I'm trying to get format, filesize, width and height from an DNG Image. With a .DNG extension identify L1004220.dng returns the correct data: L1004220.DNG DNG 5216x3472 5216x3472+0+0 16-bit sRGB 17.4867MiB 0.000u 0:00.003.
The problem now is, I've made a md5 hash from the filename and stored it somewhere else, lets call the file 17a14024496c3bea3b81362510962785. Now if I run the same command with the md5 filename it will give me another result: 17a14024496c3bea3b81362510962785 TIFF 320x216 320x216+0+0 8-bit sRGB 17.4867MiB 0.010u 0:00.008
It somehow identified it as a TIFF instead of a DNG image.
But when I give 17a14024496c3bea3b81362510962785 a .dng extension, it again works.
I only have this problem with DNG images. Other formats work as expected.
I run it on Linux. I installed the libraw-dev package which ImageMagick uses as a delegate for DNG Images. I use a self compiled ImageMagick 7.
For testing I used a sample image (Original DNG (18MB)) from here https://www.kenrockwell.com/leica/m9/sample-photos-3.htm
Anyone encountered this problem before? Am I using the wrong package as delegate?
I was able to solve the problem by adding dng: before the filename like:
identify dng:17a14024496c3bea3b81362510962785
result:
dng:17a14024496c3bea3b81362510962785=>17a14024496c3bea3b81362510962785 DNG 5216x3472 5216x3472+0+0 16-bit sRGB 17.4867MiB 0.010u 0:00.003
I found how to convert my pdf into png files with the convert command. It is great because out of the box it creates an image for each pages in the pdf which is exacly what I need. The thing is I don't know in advance how many pages my pdf has, so I don't know how many pages convert has created. I looked and looked on the Internet and read the imagemagick site but could not find an appropriate way to output the information I need.
I need a very simple output, something like this:
$ convert in.pdf out.png
out-0.png
out-1.png
out-2.png
...
In ImageMagick, just do:
identify in.pdf
in.pdf[0] PDF 256x256 256x256+0+0 16-bit sRGB 139350B 0.000u 0:00.002
in.pdf[1] PDF 256x256 256x256+0+0 16-bit sRGB 139350B 0.010u 0:00.001
in.pdf[2] PDF 256x256 256x256+0+0 16-bit sRGB 139350B 0.010u 0:00.000
or if you only want the names, then
identify -format "%f[%p]\n" in.pdf
in.pdf[0]
in.pdf[1]
in.pdf[2]
or if you just want to know the number of pages:
identify -format "%n\n" in.pdf | head -n 1
3
Note without the pipe to head, you will get 3 repeated 3 times
See
https://imagemagick.org/script/identify.php
https://imagemagick.org/script/escape.php
-strip actually removes some metadata in case of ImageMagick. What type of metadata actually it removes?
In ImageMagick, it has been noticed that
strip the image of any profiles, comments or these PNG chunks:
bKGD,cHRM,EXIF,gAMA,iCCP,iTXt,sRGB,tEXt,zCCP,zTXt,date.
What are these chunks?
What about other format images?
They are chunks that are not necessary for displaying an image.
These are described in the PNG specification:
bKGD,cHRM,gAMA,iCCP,iTXt,sRGB,tEXt,zTXt.
zCCP is an ICCP profile stored in an iTXt or zTXt chunk.
date: Image creation date and modification date that
would otherwise be autimatically inserted by ImageMagick
EXIF: camera data usually coming from a JPEG or RAW image.
Based on this question for imagemagick, what is the equivalent for graphicsmagick? Recipe for creating Windows ICO files with ImageMagick?
Also I just want to generate a fully transparent ico file with multiple sizes. I found that there's an xc:none option that works for both, but is there one single command that generates ico files with multiple sizes that is transparent? Otherwise I would have to first create a transparent png file, then create ico files from the png file.
AFAIK, GraphicsMagick doesn't support writing ICO format files - see here.
Just in case anyone knows more about this mad Microsoft format and if it is maybe some sort of multi-page TIF or GIF in disguise that just needs to be renamed, the following would be one way of making a recipe in GraphicsMagick:
#!/bin/bash
{ echo convert image.png mpr:initial;
echo convert mpr:initial -resize 16x16 mpr:16;
echo convert mpr:initial -resize 32x32 mpr:32;
echo convert mpr:initial -resize 48x48 mpr:48;
echo convert mpr:initial -resize 64x64 mpr:64;
echo convert mpr:16 mpr:32 mpr:48 mpr:64 -colors 256 favicon.tif; } | gm batch -prompt off
For the moment, I have created a multi-page TIF as the output file and it contains the four sizes you need - but as I said, GraphicsMagick will not write a ICO file.
When I try to convert a jpg image to a png, I get the following errors message occasionally. What does it mean?
> gm convert xxx.jpg png32:xxx.png
gm convert: profile matches sRGB but writing iCCP instead (xxx.png).
It's not an error but a warning.
Your input file (xxx.jpg) contains an ICC profile that represents sRGB. The png writer notices that, and issues a warning (because writing a 13-byte sRGB chunk is more efficient than writing a multi-kilobyte iCCP chunk). These days, even the sRGB chunk is wasteful if your image is intended to be displayed by a browser, because browsers assume that pixels are in the sRGB colorspace anyhow, when there is no color information present in the PNG file.