Another thing I’m thinking about is taking an MPO file and extracting the two images. An MPO file is a file that contained a number of JPEG files. In this case, it’s a Fuji stereoscopic camera where you get a left and right image in the MPO file.
I know that each JPEG starts with a marker, so I assumed that if I can somehow split the data at those points, I can get the left and right images. I’ve not been able to find any information on how to achieve what I’m thinking about. I have a little code in my stack, which looks like this:
Code: Select all
command processMPO thisFile
# Open the file
put URL ("binfile:" & thisFile) into theBinaryData
answer length(theBinaryData) -- Returns the size of the file
# look for the JPEG markers - FFD8FFE1
put binaryEncode("H*", "FFD8FFE1") into jpegMarker
answer jpegMarker
split theBinaryData by jpegMarker
answer length(theBinaryData[0]) -- Currently returns 0
answer length(theBinaryData[1]) -- Currently returns 0
end processMPO