|
From: | Adam Fedor |
Subject: | Re: NSImage initWithData: and jpegs |
Date: | Wed, 8 Oct 2003 09:52:43 -0600 |
On Wednesday, October 8, 2003, at 07:13 AM, Björn Giesler wrote:
Hi,another one... I haven't quite grokked the backend/frontend weaving of images, so maybe someone who knows better can tell me this: Why, if I have a jpeg file called "pic.jpg", does[[NSImage alloc] initWithContentsOfFile: @"pic.jpg"] return a valid NSImage, but[[NSImage alloc] initWithData: [NSData dataWithContentsOfFile: @"pic.jpg"]]return nil? Is this some problem with JPEG magic numbers?
Image reading is really hacked together (I can say that because I did it :-) ), currently it uses functions from wrlib (WIndowMaker) to read jpg, pnm files, etc which only take filenames as input. Really NSBitmapImageRep should be re-written to use libjpg, etc directly to read images from anywhere.
[Prev in Thread] | Current Thread | [Next in Thread] |