Hi Vlasta,
I'm using a Windows 10 machine with the latest (unstable). If I batch convert some PNGs to ICOs it works. But if I then try to "clean up" those icons the files seem to get broken. Here's a screenshot of my batch setup (where I am removing the larger icon components.)
https://www.screencast.com/t/s4h4Kphs
Here is the outcome. Files are being created, and the files do have the .ico extension. But my file manager doesn't display thumbs of the image. Also, if I open one of the .ico files in RWIE, you can see that the RWIE window is empty...
https://www.screencast.com/t/tiT6I810J9
Any thoughts on what I might be doing wrong?
Due to some internal modifications, the script needs to be updated to this:
var sizesTx = Configuration.GetValue("sizes");
var depthsTx = Configuration.GetValue("depths");
var sizes = sizesTx.split(',');
var depths = depthsTx.split(',');
var icon = Document.Icon;
var depthmap = [];
depthmap[icon.RGB22A8] = 32;
depthmap[icon.RGB22A8x2] = 32;
depthmap[icon.TrueColor] = 24;
depthmap[icon.Palette8] = 8;
depthmap[icon.Palette8Mac] = 8;
depthmap[icon.Palette4] = 4;
depthmap[icon.Palette4Win] = 4;
depthmap[icon.Palette4Mac] = 4;
depthmap[icon.Palette1] = 1;
depthmap[icon.Palette1BW] = 1;
depthmap[icon.RGB18A8] = 32;
var formats = icon.FormatIDs;
for (var i = 0; i < formats.length; ++i)
{
var format = formats[i];
var sizeOK = false;
for (var j = 0; !sizeOK && j < sizes.length; ++j)
{
var size = parseInt(sizes[j]);
sizeOK = size == format.SizeX;
}
var depthOK = false;
for (var j = 0; !depthOK && j < depths.length; ++j)
{
var depth = parseInt(depths[j]);
depthOK = depth == depthmap[format.Colors];
}
if (!sizeOK || !depthOK)
icon.DeleteImage(format);
}
Yep. That fixed it. Many thanks Vlasta!