Re: favicons
Re: favicons
- Subject: Re: favicons
- From: Nicko van Someren <email@hidden>
- Date: Fri, 30 Apr 2004 12:14:39 +0100
On 30 Apr 2004, at 06:57, Jim Witte wrote:
The icon itself is stored in an root file called 'favicon.ico' or
something like that - look around on the tutorial pages on creating
them. As for downloading them into an NSImage or something - I have
no idea - perhaps WebKit has a method for easily downloading one file
and parsing the image?
The following python works for me (assuming u is set to the URL that
you have in hand):
>>> v = NSURL.URLWithString_relativeToURL_("/favicon.ico", u)
>>> i = NSImage.alloc().initWithContentsOfURL_(v)
In Objective-C this would be:
// Assumes NSURL *u to be the URL for which you need the favicon
NSImage *iconImage = [[NSImage alloc] initWithContentsOfURL: [NSURL
URLWithString: "/favicon.ico" relativeToURL: u]];
As for whether you can convince WebKit to give up the icon out of its
cache if it's already loaded, I'm not sure.
Nicko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: | |
| >favicons (From: Denise Eatherly <email@hidden>) |
| >Re: favicons (From: Jim Witte <email@hidden>) |