Re: Command line tool using NSImage?
Re: Command line tool using NSImage?
- Subject: Re: Command line tool using NSImage?
- From: John Joyce <email@hidden>
- Date: Sun, 22 Aug 2010 03:50:23 -0500
On Aug 21, 2010, at 3:09 PM, Ken Thomases wrote:
> On Aug 21, 2010, at 8:35 AM, Jaime Magiera wrote:
>
>> Has anyone heard of Apple coming up with a solution to this conundrum? Or is it Bug Report time? There has to be some way to do it securely.
>
> What exactly are you trying to do? For some tasks, there may be a safe mechanism. For example, are you aware of the "sips" tool?
> http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html
>
> Regards,
> Ken
>
Ken has a good idea here. I have done this as well and not just with Objective-C (I've used sips in Ruby scripts as well).
You can wrap sips calls in NSTask.
You will want to experiment with sips directly on some sample files first, and you may need to perform different operations with separate sips calls on the same image to achieve your desired results.
That said, sips is super fast.
The only caveat is that you may need to do some sanity checking on the file types before calling sips. It will like all good Unix style command line tools just say "nope" when it is given items that it cannot work with.
Regards,
John
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden