c# - Can't get favicon from instagram -


i need retrieve favicon of instagram. program can parse html code , retrieve appropriate url of icon: http://d36xtkk24g8jdx.cloudfront.net/bluebar/d1f7ba7/images/ico/apple-touch-icon-precomposed.png. can't read icon program because instagram puts bytes in beginning, middle , end of file when program tries download it:

var wc = new webclient(); var iconbytes = wc.downloaddata(@"http://d36xtkk24g8jdx.cloudfront.net/bluebar/d1f7ba7/images/ico/apple-touch-icon-precomposed.png"); var converter = new imageconverter(); var image = (image)converter.convertfrom(iconbytes); // crash here 'parameter invalid' 

i tried save png file web browser directly. analyzed content , came conclusion bytes array webclient returns identical contains 15 bytes in beginning, 8 bytes in end , 5 bytes in middle of array. can clean 'salt' beginning , end based on knowledge of png format, have no idea how remove garbage middle of array.

could please me figure out how download , process instagram favicon?

this google service return image:

http://www.google.com/s2/favicons?domain=www.instagram.com  

example

http://www.google.com/s2/favicons?domain= *domain* 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -