Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
- Subject: Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
- From: Henry McGilton <email@hidden>
- Date: Thu, 19 Jun 2003 08:11:00 -0700
On Thursday, June 19, 2003, at 05:05 AM, Marco Binder wrote:
Hello All,
I am creating code for writing out images in various
formats. The code uses NSBitMapImageRep's method of
representationUsingType:properties to write (so far)
GIF, JPEG, and PNG. The PNG looks good. The GIF looks
lousy (but that is to be expected as it has been dithered
down from either an incoming TIFF or JPEG. The JPEG file
comes out mangled beyond all recognition. Before I
embark on my own JPEG encoder, has anybody else done this
stuff and actually got it to work?
Havent had any problems. GIF actually seems to be buggy at times, but
JPEG worked all fine.
What more can I say... can help you without more info. You can get
another sample project from me (but be aware- it s not commented well
and some portions might be poorly coded).
Thank You Marco. I (kind of) solved the problem. The value of
the compression factor is ill defined, and the documentation is
nebulous. My understanding of JPEG is that it has a 'quality'
number between 0 and 255, and that it should be an integer.
Anyway, by playing around with the NSImageCompressionFactor
part, I got the JPEG output working.
The NSBitMapImageRep documentation is murky to the extreme
in defining this part of the interface. Examples:
o I determined by experimenting that it appears to support
only GIF89a, and there is no support for GIF87a --- well,
I suppose that is no great loss.
o There appears to be no support for 'progressive' JPEG.
o The meaning of NSImageCompressionFactor is ill-defined.
Based on what little I know about JPEG, I do not believe
that the compression factor should be a float.
o You are right --- GIF output looks flaky to me. Looks
like a part of the image gets lost.
Making slow but steady progress.
Best Wishes,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.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.