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 > Mac OS X file types

Mac OS X file types
Thread Tools
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
Dec 29, 2001, 01:21 PM
 
Hello,

Where can we find reference surrounding file types used by OS X (and others, as well)? For example, I would like to add the ability to save to icns format with a graphic manipulation tool I am working on.

It would also be helpful if anyone knows how to save to gif or jpeg since currently my app can only save to TIFF using the TIFFRepresentation to return the proper data to be saved.

Any help?

Thanks,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 30, 2001, 04:42 AM
 
Well, I'm not sure exactly how you make a icns file, but I it looks like you can convert image types using NSBitmapImageRep's representationUsingType method. (I assume you're using Cocoa since you mentioned TIFFRepresentation.)

Oh, after a quick search, I see somebody's put together a class called IconFamily. Apparently creating icons is somehow a Carbon function that this wraps in a Cocoa class. You might want to take a look at that. Not as generally helpful as "File Types Around the World" or anything, but at least you should be able to figure out how to do what you want.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 30, 2001, 10:19 AM
 
I was wondering if anyone knows how I could get an NSImage of the icon for a type of file, given the creator code and filetype? i.e. what is the icon for a file of creator 'MSIE' of type 'HTML'

I can get then finder's associated icon for an extension (e.g. foo.html) using [[NSWorkspace sharedWorkspace] iconForFileType:theExtension]

but this is not quite what I need. I note that the iconForFileType: method can also take an "encoded Filetype", but I can't seem to get this to return any image other than the 'blank document' icon.

Even if I could get this method to work with the filetype it seems inappropriate as there can be different icons for files with similar filetypes, but with different creators. (e.g. an OWEB HTML file has a different icon from an MSIE HTML file)?

Any clues?
     
   
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 01:25 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