Document icon not correct size on Mac

I have set my FileTypes, put in icons for all sizes (and yes, I have them at 72dpi), but when my app saves a document, the icon in the Finder shows up as tiny and in the upper left. In the Get Info, it looks correct, but copying out shows the same way I see it in the Finder (see attached).

What am I missing here?

What macOS version ?

All sizes
1024 x 1024 pixels included ?
Masks included at all sizes ?

Building on Sierra with XOJO 2019r3.1.

Yes, 1024s1024, 72dpi, masks included.

[quote=495197:@Jon Daggett]I have set my FileTypes, put in icons for all sizes (and yes, I have them at 72dpi), but when my app saves a document, the icon in the Finder shows up as tiny and in the upper left. In the Get Info, it looks correct, but copying out shows the same way I see it in the Finder (see attached).

What am I missing here?
[/quote]
Go into the app bundle and look at the .icns file in the resources directory. Does it also have this problem?

Extremely strange.

Did you try to boot on a different hard disk (external, not a partition) ?

Build the application after a cold boot (uit all applications / power off the computer and wait two minutes / boot and only run Xojo to build the application, quit Xojo and run the just created application)…

dont set every icon at every size :slight_smile:
I’d try only setting the 1024, 512, 256 and 64 sizes (maybe 32 as well) but definitely not the 48

Otherwise send me a link in a private message and I’ll take a peek at your project.

This was a bug in some beta version, last year if I remember right. It was subsequently fixed before release.

There are icon editors in the App Store, but a quick solution could simply be to use App Wrapper to replace the original icon. Drop the 1024x1024 picture onto it, and it will generate a brand new icns for the signed .app, which will not exhibit the bug.

I ran into something similar with the application’s icon on a new program I built on 2019r3.1 for macOS yesterday. I deleted all the icons and replaced them with 1024, 512, and 256 only and it rebuilt with the application icon displaying properly.

This may have been my problem…I think the version that didn’t build properly had a 48-pixel icon. Since the source wasn’t yet under version control, I can’t go back to check.

Personally, I use iconutil to have the correct icns files created, then add them to the resources folder using a build step.

I don’t know precisely, but it’s either part of Xcode or the Xcode command line tools. You put your PNG files in a folder, name them correctly, and the iconutil command line utility will pack them into an icns file.

I since found this:
http://stackoverflow.com/questions/12306223/ddg#20703594

Thanks, Thom :slight_smile:

I’m still having this happen.
How do I get the icons to show up correctly?
While this seems trivial and cosmetic, it’s actually a big deal.

Check to see that your image you are using. The image must be a png file 1024 by 1024 in size and I think it must be at 72 dpi. This happened to me and I changed the dpi and it corrected it.

Exactly he same problem with document icons happened to me a week ago. I had all set up correctly - FileTypes, 1024 and other size png icons with the alpha channel, 72 dpi (Xojo 2020r2.1, macOS 10.13.6). After some time, after several savings of documents, after several application buildings, it suddenly started to worked correctly - really strange.

Make sure that new the builds with new icons have at least the non-release number incremented. LaunchServices uses this number to figure out which icon is correct. otherwise it’ll just keep using the one it has.

1 Like

LaunchServices is a lazy pal :wink:

There is also an icon editor in App Wrapper 4 which I use to add icon files to my apps. It also features ICNSmini which can reduce the size of the ICNS file to a 3rd of it’s original size.

Although I’ll be honest, ICSN is being replaced in future versions with the iOS assets catalogue and so far the Apple API for this seems to undo all the ICNSmini compression :frowning: