Re: File sizes when NSImage's are included
Re: File sizes when NSImage's are included
- Subject: Re: File sizes when NSImage's are included
- From: matt neuburg <email@hidden>
- Date: Mon, 29 Dec 2003 15:43:31 -0800
On Mon, 29 Dec 2003 15:23:34 +0000, Nicko van Someren <email@hidden> said:
>
Apparently not. I sent a mail to this list a few days ago trying to
>
find out how to retrieve the original data from which the NSImage came
>
but I've not seen any replies to the post.
>
>
> add a goodly amount of compression,
>
> and then make all images no taller than 200 pixels. And yet, I'm still
>
> getting filesize increases of 500k for a simple 20k picture.
>
>
That's because the serialisation of the NSImageRep still contains
>
enough data to rebuild the object without data loss.
You might want to look at the strategy employed by TextEdit - namely, just to
save a copy of the image file, itself, within the document. There is then no
loss of file format (because you've got the file itself, not merely a
disembodied NSImage), and there is nothing to serialize. This approach is
straightforward because you can save a document as a package (like TextEdit's
.rtfd format). m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide! NOW SHIPPING...! (Finally.)
http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.