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: LSCopyKindStringForTypeInfo on Leopard



This is a known bug in Leopard that shows up with any type that binds to Preview.app.

You may be able to get around it by creating a UTI from the extension or type code (UTTypeCreatePreferredIdentifierForTag), and then get the description for the UTI (UTTypeCopyDescription).

-Chris


On Nov 12, 2007, at 1:59 AM, Arvan Pritchard wrote:

Our application writes raster files using Export Components. We offer the user a choice of formats based on the exporters we find by scanning through using:

ComponentDescription compDesc={GraphicsExporterComponentType, 0, 0, 0, graphicsExporterIsBaseExporter};
Component id=0;
while (0!=(id=FindNextComponent(id, &compDesc)) && (noErr==err))


We get details of the format from the component with

err=GraphicsExportGetDefaultFileNameExtension(ci, &ext);
err=GraphicsExportGetDefaultFileTypeAndCreator(ci, &type, &creator);


and then ask Launch Services for a name to show the user with:


LSCopyKindStringForTypeInfo(type, creator, cfext, &kind); (cfext can be NULL or a CFStringRef built from ext)


This works well on Jaguar and Tiger, returning distinct names like:

Silicon Graphics Image
Apple PICT Document
Targa Image

Unfortunately on Leopard all the formats except "JPEG 2000 Image" return "Preview Document"

I have reported rdar://5353626, but wondered if anyone else has encountered the problem and/or can suggest a workaround.

Thanks
   Arvan

--
Arvan Pritchard
Informatix Software International Limited

_______________________________________________
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

_______________________________________________ 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: 
 >LSCopyKindStringForTypeInfo on Leopard (From: Arvan Pritchard <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.