icon:auto-resize

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

icon:auto-resize

Post by Mahroun »

2014-01-09 6.8.8-2 Changelog says:
Added option 'icon:auto-resize' to automatically store multiple sizes in an ico image (requires 256x256 input image).
I tested it and the output ICO file contains only one 256x256 image.

Code: Select all

convert.exe "%input_image%" icon:auto-resize "%output_image%"
Also where do I define which sizes to include? Can't find reference in the manual.

It's a nice option if its flexible
Thanks
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: icon:auto-resize

Post by dlemstra »

You should use the following command:

Code: Select all

convert.exe "%input_image%" -define icon:auto-resize "%output_image%"
At this moment you cannot define the sizes yourself. Might be a good idea to make this flexible and add support for the following:

Code: Select all

convert.exe "%input_image%" -define icon:auto-resize=128,64,32 "%output_image%"
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Re: icon:auto-resize

Post by Mahroun »

Thanks dlemstra.

It contains pretty much all common sizes, but I think it would be much better to have the sizes user-defined.
Also it fails on GIF.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: icon:auto-resize

Post by dlemstra »

What do you mean by it fails on gif? Can you provide me with an example?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Re: icon:auto-resize

Post by Mahroun »

I did a quick test on a virtual machine because the new IM is not portable and I only run portable apps on my computer.
Your code worked fine on jpg and png, but the output of gif was an empty ico file.
Could be because that gif contained more than one image, needs more testing, so will wait until a portable 32 is out and test again.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: icon:auto-resize

Post by dlemstra »

I just added support for the following:

Code: Select all

convert.exe "%input_image%" -define icon:auto-resize=128,64,16 "%output_image%"
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Re: icon:auto-resize

Post by Mahroun »

That's great,

Did you test it on a gif? As I said earlier, I tested it once and it failed on gif with multiple images.
Also I think you need to update change-log page.

Hopefully you will release a portable 32 version soon and I can test it and use the new features.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: icon:auto-resize

Post by dlemstra »

I am sorry for the confusion but this feature has not been released yet. It will be included in the next version of ImageMagick (6.8.8-3).
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: icon:auto-resize

Post by glennrp »

I added the "-define icon:auto-resize" option to the commandline documentation.
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Problem with 256 size under user defined sizes

Post by Mahroun »

There is a problem with size 256 if I define sizes

This fails:

Code: Select all

convert.exe "%input_image%" -define icon:auto-resize=256,128,32,16 "%output_image%"
Error:
convert.exe: InvalidDimensions `D:\output_image.ico' @ error/icon.c/WriteICONImage/896.

anything below 256 will work.

While this works fine to produce an ico that includes a 256 size:

Code: Select all

convert.exe "%input_image%" -define icon:auto-resize "%output_image%"
Can someone test and confirm please?
Thanks
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: icon:auto-resize

Post by dlemstra »

I can confirm this is a bug and it will be fixed in the next release of ImageMagick (6.8.9-8).
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Mahroun
Posts: 23
Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308

Re: icon:auto-resize

Post by Mahroun »

Danke Image
Post Reply