• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved


  • Subject: Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
  • From: Marco Binder <email@hidden>
  • Date: Sat, 21 Jun 2003 09:06:06 +0200

<sweat> ahem, eah, right, I forgot to tell you that the compression factor is a float between 0.0 and 1.0. And it is a compression factor rather than a quality factor as the docs suggest somewhere. However, for JPEGs, you always specify the quality / compression in a range from 0% - 100% (in the save dialogs of PhotoShop, GraphicConverter and Co.), so it maps fine into the 0.0 to 1.0 scale of Cocoa.

Marco


Am Donnerstag, 19.06.03, um 17:11 Uhr (Europe/Berlin) schrieb Henry McGilton:

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.


--
|\ /| email@hidden http://www.marco-binder.de
| \/ | Telefon: 07531 / 94 19 94 Fax: 07531 / 94 19 92
| |ARCO Snail-Mail: Banater Str. 3 - 78467 Konstanz
BINDER _____________________________________________________
_______________________________________________
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.

References: 
 >Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved (From: Henry McGilton <email@hidden>)

  • Prev by Date: Re: Opening Finder window from another app
  • Next by Date: 10.2+ Nib problems? (was Re: crash when loading nib)
  • Previous by thread: Re: JPEG from NSBitMapImageRep Mangled --- Kind Of Solved
  • Next by thread: Focus Ring Move
  • Index(es):
    • Date
    • Thread