I would like to create some tracker add-ons to manipulate a tagged image. For this I would use imagemagick, where I override the original with the convert command.
Since i am not a c or cpp programmer and i am very hard to learn this i would like to run already working yab script in a c program. I have already done that.
Now I would need someone who helps with making this program a tracker add-on. Have already done some tests for me, but so far without success.
The example CopyNameToClipboard uses stdlib.h, which I have bundled with. In addition, I have also determined all other required header files and placed in the program folder (wchar_t.h, div_t.h, alloca.h, wait.h, types.h, limits.h, stddef.h).
The program is only properly compiled but if I select it via the context menu add-ons I get only message: âError No such file or directory when loading the add-ons flipimageâ
My C Code: C and using a yab script to proceed
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
system("yab /boot/home/Desktop/im_realtime_add-on/flip_image.yab");
return 0;
}
Who wants to help me?
Would not it be great to be able to just flip, rotate, normalize, convert grayscaleâŚ
Humdinger already tried to help me, but the code he gave gives massive parse errors (Thanks for this Humdinger).
Humdingers code using the CopyNameToClipboard example and a direct running of the imagemagick command.
#include <stdio.h>
#include <stdlib.h>
extern "C" void
process_refs(entry_ref directoryRef, BMessage *msg, void *)
{
BString command;
BPath path;
int refs;
entry_ref file_ref;
for (refs = 0; msg->FindRef("refs", refs, &file_ref) == B_NO_ERROR; refs++) {
BEntry(&file_ref).GetPath(&path);
command = "convert -flip %filepath%";
command.ReplaceFirst("%filepath%", path.Path());
system(command.String());
}
}