Your module looks like it might be just what I need, however, I have a 
question. When I run the to-png-stream example with the favicon you 
provide, it works like a charm, returning two .pngs. But when I run it with 
any of my own .ico files it only returns an empty .png file (by empty I 
mean that it returns a 16 by 16 .png with no image data). I should mention 
that I haven't tried with any multiple-image .ico's, only single-image 
.ico's, but other than that I can't detect any difference between my .ico's 
and the example .ico. Also, no errors messages show up. Any hints as to 
what's going on?



On Monday, October 1, 2012 10:05:56 PM UTC-7, vicapow wrote:
>
> sorry, that was a typo in the code. imageCount should be properly set. If 
> you want to get the number of images, use ico.images.length.
>
> to make it even easier, i whipped together a module, since this might be 
> useful to others down the road: https://github.com/vicapow/fav
>
> and here's the example of converting an ico to a png: 
> https://github.com/vicapow/fav/blob/master/examples/to-png-stream.js
>
> - Victor
>
> On Monday, October 1, 2012 12:34:59 PM UTC-4, nop wrote:
>>
>> Hi Victor. Over the weekend I began poking around with node-imagemagick. 
>> I still prefer the idea of using node-canvas to manipulate bitmaps, so I'll 
>> take a close look at jParser and your code. Thank you very much for 
>> pointing me in this direction and providing your example.
>>
>> One question I had was if you intended to increment 
>> "this.current.header.imageCount" in your "images" structure? I'm a fan of 
>> explicit statement delimiters and not familiar with underscore so I'm 
>> probably confused, but it seemed an operator might be AWOL there.
>>
>>
>> On Monday, October 1, 2012 12:10:40 AM UTC-4, vicapow wrote:
>>>
>>>
>>> So, i ironically,  I recently needed a way to do this myself. 
>>> node-canvas doesn't support it but there's this package called jParser 
>>> which has a great example of reading in an ico file: 
>>> https://github.com/vjeux/jParser/blob/master/sample/ico/ico.node.js
>>>
>>> from there, i put together a little script that does basically what you 
>>> want to do. you can find it here. 
>>>
>>> https://github.com/vicapow/clickbin/blob/master/sandbox/icon-parser.js
>>>
>>> I just found out this myself but ico files can actually contain more 
>>> then one image icon. I haven't figured out how to deal with yet using the 
>>> example from jParser.
>>>
>>> On Wednesday, September 26, 2012 11:45:07 AM UTC-4, nop wrote:
>>>>
>>>> Hi. I'd like to use node-canvas to manipulate ico-format images. I 
>>>> couldn't find any mention of supported formats in the readme, but from 
>>>> my tests it seems either ico are not among them or there's an issue 
>>>> with my environment. Would someone knowledgeable in the matter please 
>>>> let me know if ico support should be there? If it isn't, it'd also be 
>>>> nice to know if it might find its way into node-canvas sometime soon. 
>>>> Thanks! 
>>>>
>>>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to