2009-09-07 5 views

답변

0

아래 코드는 작동합니다. 하지만 여전히 내 쿼리에 대한 실제 답변을 찾을 수 없습니다. 대신

sips -s formatOptions packbits /DefaultGroup.tif 

int compression = NSTIFFCompressionPackBits; 

CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)dataToWrite, NULL); 

CGImageRef imageRef = CGImageSourceCreateImageAtIndex(source, 0, NULL); 

CFMutableDictionaryRef saveMetaAndOpts = CFDictionaryCreateMutable(nil,0,&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 

CFMutableDictionaryRef tiffProfsMut = CFDictionaryCreateMutable(nil, 0, 
&kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 

CFDictionarySetValue(tiffProfsMut, kCGImagePropertyTIFFCompression, CFNumberCreate(NULL, kCFNumberIntType, &compression)); 
CFDictionarySetValue(saveMetaAndOpts, kCGImagePropertyTIFFDictionary, tiffProfsMut); 

NSURL *outURL = [[NSURL alloc] initFileURLWithPath:filename]; 
CGImageDestinationRef dr = CGImageDestinationCreateWithURL ((CFURLRef)outURL, (CFStringRef)@"public.tiff" , 1, NULL); 
CGImageDestinationAddImage(dr, imageRef, saveMetaAndOpts); 
CGImageDestinationFinalize(dr); 

CFRelease(dr); 
[outURL release]; 
CFRelease(tiffProfsMut); 
CFRelease(saveMetaAndOpts); 
CFRelease(imageRef); 

CFRelease(source); 
3

는, 즉

sips -s formatOptions pacbits /DefaultGroup.tif 

을 시도 대신에 '팩 비트'의 'pacbits'를 사용합니다.

놀랍지 만 종류가 있습니다.

관련 문제