Hello,
Is there any command to check compression type of a file.
I have some files that are corrupted and i need to use alternative for this.How can I check whether images is looking at it without using convert command ?
Example:
I have a files with old JPEG compression type and I am not able to convert those files,Hence I need to use other convertors based on Image corrupted or not.
Could you help me on this?
Is there any command to check compression type of a file.
-
- Posts: 16
- Joined: 2016-12-29T05:13:36-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Is there any command to check compression type of a file.
IM can tell you the compression type if it can read the file using identify -verbose yourimage. Somewhere listed there will be the compression. Current versions of IM can tell you that more directly from %[compression]. See http://www.imagemagick.org/script/escape.php
But if IM cannot read the file due to its having an old JPEG format that libjpeg does not support, then it won't be able to tell you the compression. Perhaps you can use EXIFTOOL to tell you that information.
But if IM cannot read the file due to its having an old JPEG format that libjpeg does not support, then it won't be able to tell you the compression. Perhaps you can use EXIFTOOL to tell you that information.
- GeeMack
- Posts: 718
- Joined: 2015-12-01T22:09:46-07:00
- Authentication code: 1151
- Location: Central Illinois, USA
Re: Is there any command to check compression type of a file.
That is how it's described under "Long Form Attribute Percent Escapes" at THIS link, but I'm using IM 7.0.4-3 on Windows 10 64, and when I run this command...fmw42 wrote: ↑2017-01-11T12:02:32-07:00Current versions of IM can tell you that more directly from %[compression]. See http://www.imagemagick.org/script/escape.php
Code: Select all
magick example.jpg -format "%[compression]" info:
Code: Select all
magick: unknown image property "%[compression]" @ warning/property.c/InterpretImageProperties/3822.
Code: Select all
magick example.jpg -format "%[C]" info:
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Is there any command to check compression type of a file.
Works fine for me on (Mac OSX SnowLeopard) IM 6.9.7.3 but fails in IM 7.0.3.4. So it seems to be an issue of not getting folded over to IM 7 or being lost in some recent release.
IM 6
JPEG
IM 7
magick: unknown image property "%[compression]" @ warning/property.c/InterpretImageProperties/3822.
IM 6
Code: Select all
convert logo.tif -format "%[compression]" info:
IM 7
Code: Select all
magick logo.tif -format "%[compression]" info: