Page 1 of 1

icon:auto-resize

Posted: 2014-01-13T05:56:38-07:00
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

Re: icon:auto-resize

Posted: 2014-01-13T06:32:12-07:00
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%"

Re: icon:auto-resize

Posted: 2014-01-13T09:51:58-07:00
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.

Re: icon:auto-resize

Posted: 2014-01-13T10:59:08-07:00
by dlemstra
What do you mean by it fails on gif? Can you provide me with an example?

Re: icon:auto-resize

Posted: 2014-01-13T11:11:13-07:00
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.

Re: icon:auto-resize

Posted: 2014-01-19T09:24:25-07:00
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%"

Re: icon:auto-resize

Posted: 2014-01-19T09:29:58-07:00
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.

Re: icon:auto-resize

Posted: 2014-01-19T11:00:29-07:00
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).

Re: icon:auto-resize

Posted: 2014-01-20T21:07:20-07:00
by glennrp
I added the "-define icon:auto-resize" option to the commandline documentation.

Problem with 256 size under user defined sizes

Posted: 2014-09-10T21:23:35-07:00
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

Re: icon:auto-resize

Posted: 2014-09-10T21:35:49-07:00
by dlemstra
I can confirm this is a bug and it will be fixed in the next release of ImageMagick (6.8.9-8).

Re: icon:auto-resize

Posted: 2014-09-10T21:54:33-07:00
by Mahroun
Danke Image