Help with Iconic Plugin

Discuss about plugins that don't have a dedicated forum
Post Reply
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Help with Iconic Plugin

Post by NathanH »

Hi,

I'm using Amiga OS3.5 with the Iconic Plugin. I have installed util/dtype/icondt.lha from Aminet. I found that, for example, the shell icon (SYS:System/Shell.info) displays poorly in Hollywood with this datatype installed. It does display perfectly in Multiview, however, with the datatype installed. I'm not sure the difference. Anyway, I thought no problem, I'll use the following code which I thought would load the icon using the Iconic Plugin rather than the datatype:

Code: Select all

@DISPLAY {width=100, height=100}

@REQUIRE "iconic"

LoadIcon(1, "SYS:System/Shell.info", {loader="iconic"})
ConvertToBrush(#ICON, 1, 1)

DisplayBrush(1, #CENTER, #CENTER)

Repeat
     WaitEvent
Forever
This code does not bypass the datatype. Is the code incorrect? If I delete the icon datatype the shell icon shows perfectly in Hollywood. Is there a way to bypass the datatype?

Since we're on this topic, there are several #ICNFMT_ constants that we can use to save icons. Is there a way to use GetAttribute() on the icon to see what type it was that was loaded by the Iconic Plugin? There doesn't seem to be anything about it in the documentation for GetAttribute().

Finally, there are several icons which display as blank (totally transparent though width and height are correct when queried) or as a small black box when using the Iconic Plugin. These icons display fine on the Workbench. Can the Iconic Plugin either fail in these cases or tell me via above that it is of #ICNFMT_UNKNOWN so that I can react accordingly in my code? Is there another way programmatically that I can tell there is a problem? Querying the width of the icon and the color of pixel (0,0) tells me that it is the black box case. I don't know how to tell in the transparent case though.

Thanks for the help!!

NathanH
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Help with Iconic Plugin

Post by airsoftsoftwair »

NathanH wrote: Sun Apr 02, 2023 12:47 am This code does not bypass the datatype. Is the code incorrect? If I delete the icon datatype the shell icon shows perfectly in Hollywood. Is there a way to bypass the datatype?
This is weird. If you pass "iconic" in the "Loader" tag of LoadIcon(), only the Iconic plugin will be asked to load the file, i.e. datatypes and all other loaders will be bypassed completely so I don't understand why activating and deactivating the datatype has an effect here. What does this report on your system?

Code: Select all

LoadIcon(1, "SYS:System/Shell.info", {loader="iconic"})
DebugPrint(GetAttribute(#ICON, 1, #ATTRLOADER))
It should always report "iconic", no matter if that icon datatype is installed or not.
NathanH wrote: Sun Apr 02, 2023 12:47 am Since we're on this topic, there are several #ICNFMT_ constants that we can use to save icons. Is there a way to use GetAttribute() on the icon to see what type it was that was loaded by the Iconic Plugin? There doesn't seem to be anything about it in the documentation for GetAttribute().
Currently not but the next version of Iconic will support it.
NathanH wrote: Sun Apr 02, 2023 12:47 am Finally, there are several icons which display as blank (totally transparent though width and height are correct when queried) or as a small black box when using the Iconic Plugin. These icons display fine on the Workbench. Can the Iconic Plugin either fail in these cases or tell me via above that it is of #ICNFMT_UNKNOWN so that I can react accordingly in my code? Is there another way programmatically that I can tell there is a problem? Querying the width of the icon and the color of pixel (0,0) tells me that it is the black box case. I don't know how to tell in the transparent case though.
Can you provide an example icon that displays fine on Workbench but not with Iconic?
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Help with Iconic Plugin

Post by NathanH »

Hi,

Thanks for responding. When I run that code on the OS that has the icon datatype installed it prints "iconic". Perhaps the datatype breaks rules or something. I thought using the iconic loader would not use the native datatype too.

I don't know how to attach a file to a post so I will send you an e-mail attachment with icons that display improperly with iconic. They include for OS3:
DirectoryOpus.info -- bad colors
Scout.info -- totally transparent
Spud.info -- black dot is displayed

and on AROS:
AROSPDF.info -- totally transparent
Zuneview.info -- totally transparent

These all display fine on Workbench/Wanderer. Thanks.

NathanH
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Help with Iconic Plugin

Post by airsoftsoftwair »

Thanks for the example files! I can confirm that they don't render correctly with the Iconic plugin. Will be fixed.
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Help with Iconic Plugin

Post by NathanH »

Thanks! Appreciate it.

NathanH
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Help with Iconic Plugin

Post by airsoftsoftwair »

Actually, only the wrong rendering of the PNG icons was a bug in Iconic. This is fixed now:

Code: Select all

- Fix: PNG icons that didn't use an alpha channel weren't loaded correctly
There's no bug in Iconic with the other icons you provided. The reason why you get strange icons with them is that you're querying the standard icon. As a compatibility mode with pre-3.5 systems, GlowIcons also contain fallback icons in case the user's Workbench doesn't have OS3.5+ installed. These fallback icons often look ugly because they are just downsampled versions of the GlowIcons. To get the GlowIcon instead of the fallback icon you need to query icon index 2 instead of 1, e.g. like this:

Code: Select all

LoadIcon(1, "Sscout.info") 
ConvertToBrush(#ICON, 1, 1, 2)
DisplayBrush(1, 0, 0)
This code should give you the correct icon.
Post Reply