• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to cache images
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to cache images


  • Subject: Re: how to cache images
  • From: Ken Thomases <email@hidden>
  • Date: Sat, 08 Jun 2013 14:24:09 -0500

On Jun 8, 2013, at 2:05 PM, Jens Alfke wrote:

> On Jun 8, 2013, at 8:01 AM, Ken Thomases <email@hidden> wrote:
>
>> Alternatively, you could force the image to load and then use +[NSBitmapImageRep representationOfImageRepsInArray:usingType:properties:] to create an NSData from the image's representations and save that to file.
>
> Not a good idea. If you do this with images that were originally JPEG, you’ll degrade the image quality if you save it out as JPEG again, since it’ll have to run the pixels through the lossy encoder again. Or if you save it in a different format the file size will go up a lot.

I haven't done the experiment, but I don't believe this is necessarily true.  NSBitmapImageRep is documented (in the Snow Leopard release notes) as keeping the original image data and not re-encoding or exploding file sizes on being saved.

"You should see less encoding and decoding of bitmap data as CGImages. If you initialize a NSImage from a JPEG file, then draw it in a PDF, you should get a PDF of the same file size as the original JPEG. In Leopard you'd see a PDF the size of the decompressed image."

Search for "NSBitmapImageRep: CoreGraphics impedance matching and performance notes" on this page:
https://developer.apple.com/library/mac/releasenotes/Cocoa/AppKitOlderNotes.html#X10_6Notes

Regards,
Ken


_______________________________________________

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


  • Follow-Ups:
    • Re: how to cache images
      • From: Jens Alfke <email@hidden>
References: 
 >how to cache images (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: how to cache images (From: Ken Thomases <email@hidden>)
 >Re: how to cache images (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: how to cache images
  • Next by Date: Re: how to cache images
  • Previous by thread: Re: how to cache images
  • Next by thread: Re: how to cache images
  • Index(es):
    • Date
    • Thread