Re: Icon Overlay on Mac OSX
Re: Icon Overlay on Mac OSX
- Subject: Re: Icon Overlay on Mac OSX
- From: Jens Alfke <email@hidden>
- Date: Thu, 02 Aug 2012 19:26:09 -0700
On Aug 2, 2012, at 6:54 PM, KappA <email@hidden> wrote:
> get the attributes
> get the icon
> composite the overlay
> set the icon
> set the attributes
This has an obvious race condition, but it should work most of the time. If you don't change the icon often, you should be OK.
> I am not sure how this affects MD5 checksum, I am going to look into that next...
It doesn't, because it doesn't affect the contents of the file. Unless you use a fancy checksum tool that incorporates all the extended-attribute metadata.
It *is* going to affect the disk space used, though. Since a 512x512 32-bit icon is a megabyte in size, that means you may be adding 1MB per file you badge. That can add up. And it's not at all obvious to a user where that space went, or how to recover it. So I would avoid doing this to lots of files.
It also slows down the Finder a bit since it has to open the file and read the icon instead of just looking it up from a cache based on the file-type. (This can be really painful when viewing that folder over AFP file sharing, in fact IIRC the Finder may turn off the display of custom icons on remote folders for this reason.)
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden