• 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:NSBitmapImageRep compression...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:NSBitmapImageRep compression...


  • Subject: Re:NSBitmapImageRep compression...
  • From: Andrei Kolev <email@hidden>
  • Date: Sat, 25 Aug 2001 00:38:21 +0300

Hi Ken,

NSTIFFCompressionJPEG means JPEG compression WITHIN the TIFF file. TIFF file specification allows this but I have not seen somebody using it (TIFF allows also LZW compression for example).
You have to use (JPEG example):
noErr = [[NSFileManager defaultManager] createFileAtPath:yourFilePath contents:
[yourNSBitmapImageRep
representationUsingType:NSJPEGFileType
properties:fileProperties]
attributes:filePermissions];

where
fileProperties = [NSDictionary dictionaryWithObjectsAndKeys:compression, NSImageCompressionFactor, nil];

compression is of type NSNumber (0 - min quality, max compression; 1 - max quality, min compression), NSImageCompressionFactor is a key, look for other constants and file types.

Only JPEG needs compression factor, it is ignored for other file types.

Best Regards,
Andrei


  • Prev by Date: Re: Help on adding help
  • Next by Date: Re: Getting the image of a window?
  • Previous by thread: Re: NSBitmapImageRep compression...
  • Next by thread: Upgrading old nibs
  • Index(es):
    • Date
    • Thread