Re:NSBitmapImageRep compression...
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