IM is not identifying ICO files without suffix

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

IM is not identifying ICO files without suffix

Post by imname »

IM is not identifying ICO files without *.ico suffix. Therefore, all commands are returning the same error:

identify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/508.

Whereas, all other extensions are identified properly without suffix or even with the incorrect one.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM is not identifying ICO files without suffix

Post by magick »

Add -debug module to your command-line. Does the output give you insight into the problem? We tried converting an ICO image and it works for us (ImageMagick 7.0.2-3).
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

Re: IM is not identifying ICO files without suffix

Post by imname »

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<log>
  <event>2016-07-16T15:39:28+03:00 0:00.003 0.016u 7.0.2 Configure identify[6632]: utility.c/ExpandFilenames/943/Configure
  Command line: identify {-debug} {All} {google}</event>
  <event>2016-07-16T15:39:28+03:00 0:00.004 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.004 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.004 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.004 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.004 0.016u 7.0.2 Configure identify[6632]: configure.c/GetConfigureOptions/682/Configure
  Searching for configure file: "I:\Soft\ImageMagick\magic.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.005 0.016u 7.0.2 Configure identify[6632]: configure.c/GetConfigureOptions/682/Configure
  Searching for configure file: "C:\Users\username\AppData\Local\ImageMagick\magic.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.005 0.016u 7.0.2 Configure identify[6632]: magic.c/LoadMagicCache/849/Configure
  Loading magic configure file "I:\Soft\ImageMagick\magic.xml" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.006 0.016u 7.0.2 Policy identify[6632]: policy.c/IsRightsAuthorized/577/Policy
  Domain: Path; rights=Read; pattern="google" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.006 0.016u 7.0.2 Blob identify[6632]: blob.c/OpenBlob/2587/Blob
    read 3 magic header bytes</event>
  <event>2016-07-16T15:39:28+03:00 0:00.006 0.016u 7.0.2 Policy identify[6632]: policy.c/IsRightsAuthorized/577/Policy
  Domain: Coder; rights=Read; pattern="" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.006 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: configure.c/GetConfigureOptions/682/Configure
  Searching for configure file: "I:\Soft\ImageMagick\delegates.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: configure.c/GetConfigureOptions/682/Configure
  Searching for configure file: "C:\Users\username\AppData\Local\ImageMagick\delegates.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.007 0.016u 7.0.2 Configure identify[6632]: delegate.c/LoadDelegateCache/2016/Configure
  Loading delegate configuration file "I:\Soft\ImageMagick\delegates.xml" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.008 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.009 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.009 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.009 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.010 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.010 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.011 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.011 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.011 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.012 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.012 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.012 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.012 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.013 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.013 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.013 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.013 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.014 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.014 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.014 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTLocateGhostscript/1178/Configure
  Ghostscript ((null)) version 0.00</event>
  <event>2016-07-16T15:39:28+03:00 0:00.015 0.016u 7.0.2 Policy identify[6632]: policy.c/IsRightsAuthorized/577/Policy
  Domain: Path; rights=Read; pattern="google" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.016 0.016u 7.0.2 Blob identify[6632]: blob.c/OpenBlob/2587/Blob
    read 3 magic header bytes</event>
  <event>2016-07-16T15:39:28+03:00 0:00.016 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.016 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.016 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.016 0.016u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.017 0.031u 7.0.2 Locale identify[6632]: locale.c/GetLocaleOptions/829/Locale
  Searching for locale file: "I:\Soft\ImageMagick\locale.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.017 0.031u 7.0.2 Locale identify[6632]: locale.c/GetLocaleOptions/829/Locale
  Searching for locale file: "C:\Users\username\AppData\Local\ImageMagick\locale.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.017 0.031u 7.0.2 Configure identify[6632]: locale.c/LoadLocaleCache/1183/Configure
  Loading locale configure file "I:\Soft\ImageMagick\locale.xml" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.018 0.031u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.018 0.031u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.019 0.031u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/1992/Configure
  SOFTWARE\ImageMagick\7.0.2\Q:16</event>
  <event>2016-07-16T15:39:28+03:00 0:00.019 0.031u 7.0.2 Configure identify[6632]: nt-base.c/NTRegistryKeyLookup/2013/Configure
  ConfigurePath</event>
  <event>2016-07-16T15:39:28+03:00 0:00.019 0.031u 7.0.2 Locale identify[6632]: locale.c/GetLocaleOptions/829/Locale
  Searching for locale file: "I:\Soft\ImageMagick\english.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.019 0.031u 7.0.2 Locale identify[6632]: locale.c/GetLocaleOptions/829/Locale
  Searching for locale file: "C:\Users\username\AppData\Local\ImageMagick\english.xml"</event>
  <event>2016-07-16T15:39:28+03:00 0:00.020 0.031u 7.0.2 Configure identify[6632]: locale.c/LoadLocaleCache/1183/Configure
  Loading locale configure file "I:\Soft\ImageMagick\english.xml" ...</event>
  <event>2016-07-16T15:39:28+03:00 0:00.027 0.031u 7.0.2 Exception identify[6632]: constitute.c/ReadImage/508/Exception
  no decode delegate for this image format `'</event>
  <event>2016-07-16T15:39:28+03:00 0:00.027 0.031u 7.0.2 Cache identify[6632]: cache.c/DestroyPixelCache/940/Cache
  destroy </event>
</log>
Last edited by imname on 2016-07-16T05:54:20-07:00, edited 1 time in total.
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

Re: IM is not identifying ICO files without suffix

Post by imname »

Same file with added suffix:
magick identify google.ico
google.ico[0] ICO 16x16 16x16+0+0 32-bit sRGB 5.43KB 0.000u 0:00.000
google.ico[1] ICO 32x32 32x32+0+0 32-bit sRGB 5.43KB 0.000u 0:00.006

I used this file:
https://www.google.com/images/branding/ ... g_lodp.ico

UPD: Sorry I forget to mention that I'm using ImageMagick 7.0.2-0 , not 7.0.2-3. Is it critical in my case?
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

Re: IM is not identifying ICO files without suffix

Post by imname »

My English is not perfect, so just to clarify, here are steps to reproduce the error:

1) Take the googleg_lodp.ico file
2) Rename it to googleg_lodp (without .ico suffix)
3) Execute the command: magick identify googleg_lodp
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: IM is not identifying ICO files without suffix

Post by magick »

Try this filename: ico:googleg_lodp.
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

Re: IM is not identifying ICO files without suffix

Post by imname »

It works, thank you.
However, my objectives include automatic usage of "convert" command on files with random formats and some of them do not have suffixes. ImageMagic works perfectly for my purpose, except for the case with ICO files. It would be great if you add the same identification support for ICO, as for other formats, in future versions of IM.

Nevertheless, your product is excellent! Thank you.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: IM is not identifying ICO files without suffix

Post by glennrp »

The "magic number" for an ICO file is hex 0001. That's not much to go by. Lots of files could begin with those four bytes.
imname
Posts: 8
Joined: 2016-07-16T01:49:34-07:00
Authentication code: 1151

Re: IM is not identifying ICO files without suffix

Post by imname »

I'm not a programmer but I would offer the following logic to solve this:

0. Processing file without suffix
1. Tying to identify using all available formats, except ICO
2. If file is not recognized, then trying to put ico: at the begining of the filename (as suggested by magick)
3. If successful, we get the desired result.
4. If not, then return error message.
Post Reply