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: Scott Anguish <email@hidden>
- Date: Tue, 30 Dec 2003 01:33:29 -0500
On Dec 29, 2003, at 6:43 PM, matt neuburg wrote:
>
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.
>
it's also troublesome.
you need to be able to keep the full image (as many as there are)
loaded at the same time. this might or might not be a significant
issue when it comes to ram consumption.
without doing some major twiddling though, it's the easy solution.
it'd be better to get the data in some lossless format (TIFF, maybe
PNG) that could then be written out as data as part of the object
stream.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.