Re: How to write a .icns file

2014-06-03 Thread John Brownie
John Brownie wrote: Thanks for the thoughts. I am not sure that I agree with the statement that the 'icns' format is well documented. A search turned up the Wikipedia page, which is pretty cursory, but eventually led me to the IconFamily page, which looks (at a first glance) to do what I need,

Re: How to write a .icns file

2014-06-03 Thread Graham Cox
On 4 Jun 2014, at 9:00 am, John Brownie john_brow...@sil.org wrote: 2. Doing it manually, I need to get a PNG representation of a particular NSImageRep, but there doesn't seem to be a way of ensuring that I really have an NSBitmapImageRep. Casting brings up a warning that I'm making an

Re: How to write a .icns file

2014-06-03 Thread John Brownie
On Wed Jun 04 2014 10:08:43 GMT+1000 (PGT) Graham Cox wrote: But as long as the rep supports being drawn, you can always create your own NSBitmapImageRep and draw any other kind of rep into it, then extract the data of the one you created as PNG. --Graham That was the trick I was missing —

Re: How to write a .icns file

2014-06-02 Thread John Brownie
On Sat May 31 2014 12:37:59 GMT+1000 (PGT) Gary L. Wade wrote: Maybe you could get by just saving those icons that are more modern? You may truly need to keep them, but there's practically no need for 'ICN#' and their like anymore in modern OS X. The most modern ones (especially the

Re: How to write a .icns file

2014-06-02 Thread Gary L. Wade
The file format for an icns file is the same as an 'icns' resource, which is documented in IconStorage.h. -- Gary L. Wade (Sent from my iPhone) http://www.garywade.com/ On Jun 2, 2014, at 5:04 PM, John Brownie john_brow...@sil.org wrote: On Sat May 31 2014 12:37:59 GMT+1000 (PGT) Gary L.

Re: How to write a .icns file

2014-06-02 Thread Ken Thomases
On Jun 2, 2014, at 7:04 PM, John Brownie wrote: I don't see a simple way of working out which ones are the @2x versions for the purposes of creating a full .icns file, either. I would expect that you could compare the size of the image rep vs. its (pixelsWide, pixelsHigh) dimensions.

Re: How to write a .icns file

2014-06-01 Thread Mike Abdullah
On 29 May 2014, at 23:38, John Brownie john_brow...@sil.org wrote: Simplified from the previous question, which didn't get any responses: How can I write a .icns file when there are 15 images, which is too many for ImageIO to handle? I can get it as an NSImage, but can't see how to write

Re: How to write a .icns file

2014-06-01 Thread Uli Kusterer
On 01 Jun 2014, at 04:25, Mike Abdullah mabdul...@karelia.com wrote: On 29 May 2014, at 23:38, John Brownie john_brow...@sil.org wrote: Simplified from the previous question, which didn't get any responses: How can I write a .icns file when there are 15 images, which is too many for

Re: How to write a .icns file

2014-06-01 Thread Mike Abdullah
On 1 Jun 2014, at 17:04, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 01 Jun 2014, at 04:25, Mike Abdullah mabdul...@karelia.com wrote: On 29 May 2014, at 23:38, John Brownie john_brow...@sil.org wrote: Simplified from the previous question, which didn't get any responses: How can

Re: How to write a .icns file

2014-05-30 Thread Gary L. Wade
Maybe you could get by just saving those icons that are more modern? You may truly need to keep them, but there's practically no need for 'ICN#' and their like anymore in modern OS X. The most modern ones (especially the retina-based ones) are just wrappers around PNG, JPEG, image file data,

How to write a .icns file

2014-05-29 Thread John Brownie
Simplified from the previous question, which didn't get any responses: How can I write a .icns file when there are 15 images, which is too many for ImageIO to handle? I can get it as an NSImage, but can't see how to write it to a file (or to an NSData object). John -- John Brownie,