some questions about creating image thumbnails
some questions about creating image thumbnails
- Subject: some questions about creating image thumbnails
- From: Jesse Grosjean <email@hidden>
- Date: Wed, 9 Apr 2008 11:32:58 -0400
I have a situation where I've got a NSImage reference in memory and
I'd like to save that image at full size and in a number of thumbnail
sizes as quickly as possible. I know how to implement the basics, but
I have no idea if I'm doing it in the most efficient way. In particular:
To save the full sizes image I'm using some code like this:
[[artworkImage
TIFFRepresentationUsingCompression:NSTIFFCompressionNone factor:0]
writeToFile:file atomically:NO]
That brings up these questions:
1. If I don't care about on disk size is NSTIFFCompressionNone a fast
way to write? (assuming that compression would take more time). Or
maybe compression will actually save me time since the disk write will
be faster?
2. And how does the image format effect read time, after all that's
what I'm really trying to optimize in the first place by creating the
caches?
2. Is TIFFRepresentation a good way to go or should I really be using
some other framework like image IO or something else if I'm concerned
with efficiency.
For the thumbnails I'm just creating new NSImages of the correct size,
locking focus on them, and then drawing the original image into the
smaller image, and writing them out as above. Is there a smarter way?
I've heard (or maybe imagined) that some image file formats will
already embed their own thumbnails. Is that a better way to do
things... what image formats support that if any?
Thanks for any pointers.
Jesse
_______________________________________________
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