Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTI Question





On Mar 9, 2007, at 9:29 AM, Marco Piovanelli wrote:
I thought I could avoid generating dynamic UTIs by including an
exhaustive UTImportedTypeDeclarations list in my Info.plist,
with mappings such as:

   image/x-canon-crw               com.canon.crw-raw-image
   image/vnd.adobe.photoshop       com.adobe.photoshop-image

The problem is that the system already has declarations for these UTIs which do not include the MIME types you cite.


I found that if I include a list of *exported* type declarations
in my Info.plist, the mappings are "activated", and
UTTypeCreatePreferredIdentifierForTag() works as expected,
but I'm not sure using exported is the right thing.

I agree it's probably not the right thing in this case. Etiquette suggests that you don't have the standing to export a UTI declaration in the canon.com domain. You're essentially trying to fix Apple's built-in declaration to include the MIME types you're expecting.


(By the way, Apple has no MIME type for com.canon.crw-raw-image, but FOUR for com.adobe.photoshop-image: image/photoshop, image/x- photoshop, image/psd and application/photoshop. It looks like when we first declare the photoshop UTI, image/vnd.adobe.photoshop wasn't registered with IANA. We'll fix the UTI declarations in the next release. Report bugs like these to make sure we track the issue.)


Any suggestions?

A pragmatic suggestion: write a wrapper to UTTypeCreatePreferredIdentifierForTag which checks the result of UTTypeCreatePreferredIdentifierForTag. If it returns a dynamic UTI string, then you invoke your own mapping of MIME types to UTIs, and your wrapper returns the "fixed" UTI. This way, when a future OS includes a proper mapping for the MIME type "image/ vnd.adobe.photoshop," your fix-up code will not be invoked because UTTypeCreatePreferredIdentifierForTag will stop returning a dynamic type string.


-Chris

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >UTI Question (From: "Marco Piovanelli" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.