Message from discussion
node-canvas ico support?
Received: by 10.236.161.8 with SMTP id v8mr14188180yhk.18.1349154367991;
Mon, 01 Oct 2012 22:06:07 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.236.149.34 with SMTP id w22ls101738yhj.8.gmail; Mon, 01 Oct
2012 22:05:57 -0700 (PDT)
Received: by 10.236.198.80 with SMTP id u56mr2315755yhn.0.1349154357292;
Mon, 01 Oct 2012 22:05:57 -0700 (PDT)
Date: Mon, 1 Oct 2012 22:05:56 -0700 (PDT)
From: vicapow <vicapowel...@gmail.com>
To: nodejs@googlegroups.com
Message-Id: <87c42c41-12f4-4331-aace-a81ce123ed67@googlegroups.com>
In-Reply-To: <9111798d-bb33-47c0-ba5d-9e280c0f60aa@googlegroups.com>
References: <7d67a62b-c5c9-4c47-8f6d-47a286f2d953@cf4g2000vbb.googlegroups.com>
<f0c265c6-c4a5-4c2d-9979-b4aa98973397@googlegroups.com>
<9111798d-bb33-47c0-ba5d-9e280c0f60aa@googlegroups.com>
Subject: Re: node-canvas ico support?
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_286_32901145.1349154356788"
------=_Part_286_32901145.1349154356788
Content-Type: multipart/alternative;
boundary="----=_Part_287_6590603.1349154356791"
------=_Part_287_6590603.1349154356791
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
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!
>>>
>>
------=_Part_287_6590603.1349154356791
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
sorry, that was a typo in the code. imageCount should be properly set. If y=
ou want to get the number of images, use ico.images.length.<div><br></div><=
div>to make it even easier, i whipped together a module, since this might b=
e useful to others down the road: <a href=3D"https://github.com/vicapow/fav=
">https://github.com/vicapow/fav</a></div><div><br></div><div>and here's th=
e example of converting an ico to a png: https://github.com/vicapow/fa=
v/blob/master/examples/to-png-stream.js</div><div><br></div><div>- Victor</=
div><div><br>On Monday, October 1, 2012 12:34:59 PM UTC-4, nop wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;">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.<br><br>One question I had was if you intended to increment "t=
his.current.header.<wbr>imageCount" in your "images" structure? I'm a fan o=
f explicit statement delimiters and not familiar with underscore so I'm pro=
bably confused, but it seemed an operator might be AWOL there.<br><br><br>O=
n Monday, October 1, 2012 12:10:40 AM UTC-4, vicapow wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div><br></div>So, i ironically, I recently n=
eeded a way to do this myself. node-canvas doesn't support it but there's t=
his package called jParser which has a great example of reading in an ico f=
ile: <a href=3D"https://github.com/vjeux/jParser/blob/master/sample/ic=
o/ico.node.js" target=3D"_blank">https://github.com/<wbr>vjeux/jParser/blob=
/master/<wbr>sample/ico/ico.node.js</a><div><br></div><div>from there, i pu=
t together a little script that does basically what you want to do. you can=
find it here. </div><div><br></div><div><a href=3D"https://github.com=
/vicapow/clickbin/blob/master/sandbox/icon-parser.js" target=3D"_blank">htt=
ps://github.com/vicapow/<wbr>clickbin/blob/master/sandbox/<wbr>icon-parser.=
js</a><br></div><div><br></div><div>I just found out this myself but ico fi=
les can actually contain more then one image icon. I haven't figured out ho=
w to deal with yet using the example from jParser.<br><br>On Wednesday, Sep=
tember 26, 2012 11:45:07 AM UTC-4, nop wrote:<blockquote class=3D"gmail_quo=
te" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-=
left:1ex">Hi. I'd like to use node-canvas to manipulate ico-format images. =
I
<br>couldn't find any mention of supported formats in the readme, but from
<br>my tests it seems either ico are not among them or there's an issue
<br>with my environment. Would someone knowledgeable in the matter please
<br>let me know if ico support should be there? If it isn't, it'd also be
<br>nice to know if it might find its way into node-canvas sometime soon.
<br>Thanks!
<br></blockquote></div></blockquote></blockquote></div>
------=_Part_287_6590603.1349154356791--
------=_Part_286_32901145.1349154356788--