airsoftsoftwair wrote: ↑Fri Apr 18, 2025 11:13 pm
So these remarks should explain the behaviour you're seeing.
I wonder if it would do any harm if Hollywood would automatically convert them to RGB in the cases it's needed? Would be more convenient than taking all these variations into account...
jPV wrote: ↑Mon Apr 07, 2025 10:09 am
This also depends of the palette depth. Try "CreateBrush(1, 32, 32, {Palette=#PALETTE_GRAY8, FillPen=1}) " and also #ICNFMT_AMIGAOS35 and #ICNFMT_NEWICON fail.
...this might actually be a bug. But I'm not sure yet. Can you post a full
MCVE?
Here's an example that tests about all depths with those formats:
Code: Select all
@REQUIRE "iconic"
f = {
"#ICNFMT_AMIGAOS35",
"#ICNFMT_NEWICON"
}
For Local j = 2 To 8
Local colors = Pow(2, j)
CreateBrush(1, 32, 32, {Palette=GetConstant("#PALETTE_GRAY" .. colors), FillPen=3})
CreateIcon(1, {{Type=#BRUSH, Image=1}})
For Local i = 0 To ListItems(f) - 1
Local f$ = "ram:" .. UnrightStr(f[i], 8) .. "_" .. PadNum(colors, 3) .. ".info"
Local err = ?SaveIcon(1, f$, GetConstant(f[i]))
DebugPrint(f$, IIf(err, GetErrorName(err), "OK"))
Next
Next
Output from that is:
Code: Select all
ram:AMIGAOS35_004.info Error saving icon!
ram:NEWICON_004.info Error saving icon!
ram:AMIGAOS35_008.info Error saving icon!
ram:NEWICON_008.info Error saving icon!
ram:AMIGAOS35_016.info OK
ram:NEWICON_016.info OK
ram:AMIGAOS35_032.info OK
ram:NEWICON_032.info OK
ram:AMIGAOS35_064.info OK
ram:NEWICON_064.info OK
ram:AMIGAOS35_128.info OK
ram:NEWICON_128.info OK
ram:AMIGAOS35_256.info OK
ram:NEWICON_256.info OK
So it seems to fail with 4 and 8 colour icons. A funny thing is that it still writes these files despite reporting the error. The files just don't contain the requested NewIcon or GlowIcon data, but have the AmigaOS fallback icons. And actually the code in the original report also produced files for failing MacOS, PNG, and Windows icons, but they're broken with filesizes from zero to few bytes. Maybe these files shouldn't be written at all or be deleted if there was an error?
Another issue I noticed with this test, is that NewIcon images are corrupted, at least from colors 16 to 256. It might be a bit hard to spot that with this test that produces dark images, but it's quite visible with the lesser colored icons at least. Icon graphics are striped or otherwise distorted.
