[Adium-devl] Feb 1 is the Adium 1.0 release date
Ken Ferry
kenferry at mac.com
Sat Jan 27 01:28:00 UTC 2007
On Jan 26, 2007, at 5:24 PM, Ken Ferry wrote:
>
> On Jan 26, 2007, at 5:22 PM, Ken Ferry wrote:
>
>>
>> On Jan 26, 2007, at 5:08 PM, Evan Schoenberg wrote:
>>
>>>
>>> On Jan 26, 2007, at 7:40 PM, Alan Humpherys wrote:
>>>
>>>> [[NSImage alloc] initWithContentsOfFile:fileName]
>>>>
>>>> Or, if that fails, you can open it using the QuickTime libraries
>>>> (as a movie) and it will search out the format & select the right
>>>> one, then you can get an NSImage from it...
>>>>
>>>> (I don't have the code in front of me for that, so I had better
>>>> don my asbestos suit)
>>>>
>>>
>>> Sorry, neither jmpp nor I provided much context.
>>>
>>> The problem is that we have image data that we are pretty is some
>>> image. We don't know the format... but we need to write it out to
>>> disk for use elsewhere. 10.4's WebKit doesn't care whether format
>>> and extension match.. so if I write a PNG file out as "image.gif",
>>> it loads just fine. In 10.3, though, it fails to load,
>>> apparently... so we want to figure out, given an NSImage, what
>>> extension to put on it when we write it to disk.
>>
>> CGImageSource can give you a type for raw data or a file without
>> actually decoding the image (if at all possible).
>
> Oops, blocked out that you need a 10.3 solution. CGImageSource is
> 10.4 and up.
Once NSImage has really loaded the data (which may be lazy), it's just
bytes in a certain configuration. The original format has been lost
(unless I'm wrong, of course).
However, if you can load it with NSImage, you can write it out in a
format of your choosing. TIFFRepresentation will always write out
tiff data.
So, you could take your data, load it up with NSImage, and write it
out as a tiff.
-Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070126/a51c7d00/attachment-0001.html>
More information about the devel
mailing list