Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Useless function or possible BUG

Useless function or possible BUG
Thread Tools
Senior User
Join Date: Jun 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Aug 16, 2002, 05:52 PM
 
Running my code, with the following function:

Code:
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:

Code:
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:

Code:
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2