1

Backfill icons from provided images · Issue #386 · beeware/briefcase · GitHub

 1 year ago
source link: https://github.com/beeware/briefcase/issues/386
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Comments

Member

Briefcase currently requires that the user provide icons of in various formats. However, if you have a high-res PNG format, any other format can be generated by image conversion.

Briefcase should try to use a correctly named file in the right size and format if it's available; but if it isn't, it should try to backfill by converting the high-res PNG to the needed size and format. This should be clearly logged so the end user knows what has happened.

Pillow can be used for most of these operations, but Pillow doesn't currently support ICNS; however, macOS ships with a tool to generate ICNS files from PNGs.

Creating an ICNS file:

Into a directory named myicon.iconset, put files with the following names and sizes:

A 16x16@2x icon is 32x32 pixels; so yes - you need to have 2 copies of the same 32x32 icon (if you're paying close attention to the details you can specify a different icon; however, if you're autoscaling from other sizes, you're not paying that sort of attention).

Then, invoke: iconutil -c icns myicon.iconset. This will produce myicon.icns.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK