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?".
Mahroun
Posts: 23 Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308
Post
by Mahroun » 2014-01-13T05:56:38-07:00
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
dlemstra
Posts: 1570 Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2014-01-13T06:32:12-07:00
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%"
Mahroun
Posts: 23 Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308
Post
by Mahroun » 2014-01-13T09:51:58-07:00
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.
dlemstra
Posts: 1570 Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2014-01-13T10:59:08-07:00
What do you mean by it fails on gif? Can you provide me with an example?
Mahroun
Posts: 23 Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308
Post
by Mahroun » 2014-01-13T11:11:13-07:00
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.
dlemstra
Posts: 1570 Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2014-01-19T09:24:25-07:00
I just added support for the following:
Code: Select all
convert.exe "%input_image%" -define icon:auto-resize=128,64,16 "%output_image%"
Mahroun
Posts: 23 Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308
Post
by Mahroun » 2014-01-19T09:29:58-07:00
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.
dlemstra
Posts: 1570 Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2014-01-19T11:00:29-07:00
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).
glennrp
Posts: 1147 Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W
Post
by glennrp » 2014-01-20T21:07:20-07:00
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
Post
by Mahroun » 2014-09-10T21:23:35-07:00
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
dlemstra
Posts: 1570 Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2014-09-10T21:35:49-07:00
I can confirm this is a bug and it will be fixed in the next release of ImageMagick (6.8.9-8).
Mahroun
Posts: 23 Joined: 2011-12-24T02:52:08-07:00
Authentication code: 8675308
Post
by Mahroun » 2014-09-10T21:54:33-07:00
Danke