I have a mounted directory to access some images.
When opening an image for the first time with open /mounted_dir/foo.jpg
it opens the image in preview.
When repeating the same command it gives the error:
/mounted_dir/foo.jpg is damaged and can't be opened. You should move it to the Trash.
I have seen this error message on the web but only for apps, not image files. Furthermore, the file in question doesn't appear damaged, eg:
cp /mounted_dir/foo.jpg /tmp/foo.jpg
diff /mounted_dir/foo.jpg /tmp/foo.jpg #no difference
open /tmp/foo.jpg #works
open /mounted_dir/foo.jpg #same error
Is there any other way than setting preference to do this (in System Preferences > Security & Privacy: Set "Allow Applications Downloaded From" to 'Anywhere') ?
Ideally, I'd like either a open --force mode or a command line way to tell the system that the file isn't damaged, or (last resort) command line to set the System Preferences > Security & Privacy option.