On 18 Aug 2015, at 9:03 am, Malcolm Fitzgerald <email@hidden> wrote:
I compared the output of the two methods I tested
FWIW, the documents for NSBitmapImageRep, which is how Cocoa apps can do the conversion, says:
WARNING There is no guarantee that the image will render exactly the same as it would under QuickDraw because of the differences between the display medium and QuickDraw. In particular, some transfer modes and region operations may not be supported.
So given that Kevin's app is probably using QuickDraw, it's likely to give the more accurate rendition. OTOH, the issue is likely to be academic, given how the images were added in the first place.
On 18 Aug 2015, at 7:09 am, Yvan KOENIG < email@hidden> wrote:
Adding a filter was so easy that I didn't wait before inserting it
If you want more comprehensive filtering, you could insert this:
-- check if UTI of file is one NSImage can read set theWorkspace to current application's NSWorkspace's sharedWorkspace() set theType to theWorkspace's typeOfFile:oldPath |error|:(missing value) -- returns UTI of file set supportedTypes to current application's NSImage's imageTypes() -- returns supported UTIs if (supportedTypes's containsObject:theType) as boolean is false then error "File format is unsupported" -- check required type doesn't already match else if (theWorkspace's filenameExtension:destExt isValidForType:theType) as boolean then error "No conversion needed" end if
|