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 Fri, 9 Mar 2007 13:41:45 -0800,
Christopher Linn (email@hidden) wrote:


>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.

Oh right, that was the problem.

>You're essentially trying to fix Apple's built-in declaration to
>include the MIME types you're expecting.

Exactly.

>> 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.

Thanks for the suggestion.  I wrote some fallback code that
parses my own Info.plist to retrieve the "proper" mappings
from my "UTImportedTypeDeclarations" array if
UTTypeCreatePreferredIdentifierForTag()
gives me a dynamic UTI.  It works like a charm.  BTW, I'm testing
for dynamic UTIs using [uti hasPrefix:@"dyn."] -- I hope that's correct.

I also filed a bug about the IANA-sanctioned MIME type for Adobe
Photoshop images not being included in the Apple-supplied UTI
declarations -- rdar://5054763


                                        -- marco

-- 
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.

 _______________________________________________
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>)
 >Re: UTI Question (From: Christopher Linn <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.