On Jun 8, 2013, at 5:39 PM, "Gerriet M. Denkmann" <gerr...@mdenkmann.de> wrote:

> 
> On 9 Jun 2013, at 06:23, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> 
>> On Jun 8, 2013, at 12:24 PM, Ken Thomases <k...@codeweavers.com> wrote:
>> 
>>> 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.
>> 
>> I did not know this — guess I haven’t been reading the release notes closely 
>> enough.
> 
>    url = some/picture.gif
>    NSDataReadingOptions mask = 0;    //    NSDataReadingUncached
>    NSData *data = [ NSData dataWithContentsOfURL: url options: mask error: 
> &outError ];
> got 19420 bytes
> 
>    NSImage *image = [ [ NSImage alloc ] initWithContentsOfURL: url ];
>    BOOL ok = [ NSArchiver archiveRootObject: image toFile: @"/tmp/anImage" ];
> got 307559 bytes (NSKeyedArchiver adds another half  kB)
> 
> This 16-fold increase of data is - regardless of image quality - not 
> acceptable for my purposes.

This is why you don't use NSArchiver for data blobs: it writes them out as 
Base64-encoded plist strings.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to