Re: Getting NSBitmapImageRep from incomplete jpg files
Re: Getting NSBitmapImageRep from incomplete jpg files
- Subject: Re: Getting NSBitmapImageRep from incomplete jpg files
- From: Jeremy Dronfield <email@hidden>
- Date: Thu, 20 Jan 2005 19:56:53 +0000
On 18 Jan 2005, at 5:02 pm, Heinrich Giesen wrote:
On 18.01.2005, at 17:43, Jeremy Dronfield wrote:
I'm working on a application which creates thumbnails from image
files.
- - - -
However, I run into problems with image files which are incomplete.
(Typically, these are images which have been incompletely downloaded
from the web.)
I know of these images, (premature end of file) one of them I have
cannot
be shown by PreviewApp or GraphicConverter or Finder. Some aps can
show them:
Safari (but strangely stretched), ToyViewer, RealPlayer (!), and my
image handling
apps can also do it. This is because I do not use the NSBitmapImageRep
class
for loading jpeg-images, but the free jpeg library of the independent
jpeg group.
My advice: try to use this library from http://www.ijg.org/
You can load lib and sources from several places, e.g.
http://macosx.forked.net/showcat.php?cat=Libraries&sortmethod=reverse
(Be warned, using the lib is not a simple job.)
You could also try to only read the thumbnail image, if it exists in
the
APP1 data, which also is not straightforward.
Apologies for the delayed reply. Thank you for drawing my attention to
ToyViewer (which I'd never heard of before). As you say, it copes with
incomplete images and - lucky me - it's open source. It does use
NSBitmapImageRep and NSImage for displaying incomplete JPEGs, but also
uses C functions for reading the image header and line-by-line reading
of the data.
Thanks again. Regards,
Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden