Apple IconSet (.icns) file format
Install via npm
$ npm install --save apple-icns
- moimart/hyper-folder-icon – A Hyperterm extension to show the folder icon in MacOS
var Icns = require( 'apple-icns' )
var iconset = new Icns( filename )
iconset.open( function( error ) {
console.log( 'iconset', error || iconset )
})
console.log( iconset.entries )
[
IconEntry {
type: 'is32',
length: 774,
offset: 8,
width: 16,
height: 16,
depth: 24,
channels: 3,
format: 'raw',
isMask: false,
isCompressed: true,
description: '16×16 24-bit icon',
osVersion: '8.5',
uncompressedSize: 2304
},
// ... More entries omitted for brevity ...
IconEntry {
type: 'ic09',
length: 158264,
offset: 134167,
width: 512,
height: 512,
depth: -1,
channels: -1,
format: 'jpeg2000',
isMask: false,
isCompressed: false,
description: '512×512 icon in JPEG 2000 or PNG format',
osVersion: '10.5',
uncompressedSize: null
}
]
iconset.readEntryData( iconset.entries[3], function( error, buffer ) {
console.log( 'Icon', error || buffer )
})
- extraction (dumping raw jpeg/png, and decompress and combine for raw)
- creation
- addition