Re: iPhoto-like scroll view
Re: iPhoto-like scroll view
- Subject: Re: iPhoto-like scroll view
- From: glenn andreas <email@hidden>
- Date: Sat, 8 Sep 2007 10:56:29 -0500
On Sep 8, 2007, at 10:43 AM, Chris Williams wrote:
Been there, done that, got the t-shirt :)
Actually, the limiting factor (for me at least) was just schleping
the image
in from the disk, and writing it back to the database. Once I had
it in
memory, I played with all kinds of techniques to make the thumb and
nothing
made much of a difference. So I went with one that was clean and
did what I
wanted.
If you think about it, it makes sense. Just copying a folder with
several
thousand images, each several hundred K in size, is a slow operation.
That's one of the advantages of CGImageSourceCreateThumbnailAtIndex,
though, is that in many cases it doesn't have to read the entire file
to generate the thumbnail. For example, many digital cameras embed a
thumbnail in the EXIF data of a JPG file, which
CGImageSourceCreateThumbnailAtIndex can use, allowing for it to only
have to scan in the first couple of K of a file instead of reading
the entire several hundred K. Similar tricks can be done with
progressive jpg files (again just reading the first couple of low
resolution passes, and not the full resolution) and JPEG2000 files.
You might want to check out <http://www.wilshipley.com/blog/2005/09/
jpeg2000-cool-but-slow.html> as well which includes the following quote:
Followup (9/19): The news gets even better, as it turns out 10.4's
CGImageSourceCreateThumbnailAtIndex() is 3-7x faster at creating
JPEG thumbnails than the method I had to use under 10.3: creating a
CGImageRef using CGImageCreateWithJPEGDataProvider() and then
drawing it (with antialiasing turned on) into a smaller window.
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium | flame : flame fractals & strange attractors : build,
mutate, evolve, animate
_______________________________________________
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