Re: Useless function or possible BUG?
Re: Useless function or possible BUG?
- Subject: Re: Useless function or possible BUG?
- From: Ben Mackin <email@hidden>
- Date: Thu, 15 Aug 2002 20:45:05 -0700
On 8/14/02 8:51 PM, "Scott Anguish" <email@hidden> wrote:
>
TIFF files can have different types of compression... JPEG, LZW (at
>
least it was supported before) and I think one other, but i can't
>
remember off the top.
Running my code, with the following function:
myNewData = [myTIFFasBitMap TIFFRepresentationUsingCompression:
NSTIFFCompressionPackBits factor:0.0];
Produces a properly compressed tiff image (256k in size). However running my
code with the following function instead:
myNewData = [myTIFFasBitMap TIFFRepresentationUsingCompression:
NSTIFFCompressionCCITTFAX3 factor:0.0];
Produces a raw tiff file (1.8MBs, definatly NOT what I wanted). This
compression method is supported according to Apple documentation (the
unsuppored ones say they are not supported).
For a few more tests, I tried the following, as (suggested by someone on
this list) to use in place of the TIFFRepresentationUsingCompression:
myDict = [NSDictionary dictionaryWithObject:@"NSTIFFCompressionPackBits "
forKey:@"NSImageCompressionMethod"];
myNewData = [myTIFFasBitMap representationUsingType:NSTIFFFileType
properties:myDict];
And I just get a raw tiff file (1.8MBs, defiantly NOT what I wanted).
Changing the compression type to anything else just gives me the same
result, raw tiff file.
So what have I learned.
-(NSData *)representationUsingType:properties: does nothing useful at all.
It just gives me raw tiff files, no matter what compression I ask it to use.
I also learned that TIFFRepresentationUsingCompression doesn't allow all the
compressions it says it does (it only works with 3 out of the 8 or so
listed).
So my question is now this. Are these not working because Apple has them set
up for them not to work, or is something going wrong? I ask this because
what I get from the documentation is that what is not working for me should
work. I would really appreciate someone from Apple commenting on this, if
they could.
Thanks,
Ben
_______________________________________________
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.