Extract JPGs from EIPs programmatically?

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Extract JPGs from EIPs programmatically?

Postby SeanMurp » Thu Jul 26, 2018 6:56 pm

Cross posted in CO11 Software Mac: http://forum.phaseone.com/En/viewtopic.php?f=71&t=28701

I'm wondering if there is a way to programmatically extract the preview JPG files from EIP files. We use ExifTool and can do it with CR2 files but I haven't been able to figure out how to do it with the EIPs since they are a zip package. Wondering if anyone else has tried to do this?

This is the code that extracts from a CR2:
exiftool -b -PreviewImage -w _preview.jpg -ext cr2 -r /path/to/folder
SeanMurp
 
Posts: 78
Joined: Wed Nov 02, 2016 4:30 am

Re: Extract JPGs from EIPs programmatically?

Postby Eric Nepean » Thu Jul 26, 2018 11:12 pm

Hi Sean

If the file is "GM5-17_0027.eip" in the Unix shell's current folder, then the following Unix command will create the subbolder "GM5-17_0027" and extract the contents to the folder:
Code: Select all
ditto -x -k  GM5-17_0027.eip ./GM5-17_0027

The image file inside the folder is "0.RW2" in the case that the original was "GM5-17_0027.RW2"


Also useful are:
https://www.google.com/search?q=osx+command+line+archive+utility
https://stackoverflow.com/questions/7748027/use-archive-utility-app-from-command-line-or-with-applescript

"ditto" is a standard part of OSX's Unix:
Code: Select all
man ditto
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 526
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Re: Extract JPGs from EIPs programmatically?

Postby SeanMurp » Fri Jul 27, 2018 6:54 pm

Thanks Eric. This definitely works but we won't be able to process out for each file. We shoot thousands of images per day so the additional processing time is likely too much (as is actually processing out each image via CapOne). I was just hoping there was a way to sneakily pull out a preview file that was already present. If only we didn't have to use the EIP format. This additional preview extraction would be easy with just the raw files. :D
SeanMurp
 
Posts: 78
Joined: Wed Nov 02, 2016 4:30 am

Re: Extract JPGs from EIPs programmatically?

Postby Eric Nepean » Fri Jul 27, 2018 10:20 pm

So in that case, run this as a background task while the operator and the AppleScript are doing something about the next shot.

By the time the next shot is finished, the preview jpg from the previous shot has been dumped in some collection folder.

You can either write a Unix script to run in background mode, and you can even use OSX’s Archive.app as part of it.
Code: Select all
tell system events to tell application “Archive” to open [i]some_file.eip[/i]

Archive will execute this and not send a response, if you tell AppleScript to use a 0 wait time, then Archive will effectively run in the background while the AppleScript moves on.

Archive and ditto are pretty fast, it is exiftool which is slow - unless you as exiftool to process every raw file in a folder in one command. “Do shell script” is also slow. So minimize your use of these commands.
Cheers, Eric
[late 2015 iMac, 4GHz i7, 24GB RAM, external SSDs. GX8, E-M1, GX7, GM5, GM1 ....]
Eric Nepean
 
Posts: 526
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest