So here is my solution:
I associated OS X binary with my project and used NSTask to invoke binary files. You need to specify the environment variables "MAGICK_HOME" and "DYLD_LIBRARY_PATH" for NSTask to work. Here is a snippet of what I'm using.
Note that this example is hardcoded to use the compound command ... and uses hardcoded arguments, but you can change it to whatever you like ... it just serves as a proof of concept.
-(id)init { if ([super init]) { NSString* bundlePath = [[NSBundle mainBundle] bundlePath]; NSString* imageMagickPath = [bundlePath stringByAppendingPathComponent:@"/Contents/Resources/ImageMagick"]; NSString* imageMagickLibraryPath = [imageMagickPath stringByAppendingPathComponent:@"/lib"]; MAGICK_HOME = imageMagickPath; DYLD_LIBRARY_PATH = imageMagickLibraryPath; } return self; } -(void)composite { NSTask *task = [[NSTask alloc] init];
This solution combines the bulk of the entire library with your version (37 MB at the moment), so for some solutions it may be less than ideal, but it works :-)
Nippysaurus
source share