Extract JPG preview without saving

Started by gverhoev, June 20, 2016, 03:00:49 PM

Previous topic - Next topic

gverhoev

Hi All,

I am often calling exiftool from MATLAB. I now want to extract the *.jpg preview of a *.DNG file. I know this is possible with:

exiftool -b -JpgFromRaw anyfile.dng>full_preview.jpg

However, this creates an additional file "full_preview.jpg", which I would have to read into MATLAB and then delete again. Is it possible to directly extract the preview (so that I can store it as a variable in MATLAB) without having to save it?

Thanks for any insights!

Geert

Phil Harvey

Hi Geert,

This depends entirely on MATLAB.  Without the ">full_preview.jpg" part of your command, the preview will be sent to the console.  If you can capture the ExifTool console output directly in MATLAB, then you have your preview in memory.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gverhoev

Hi Phil,

OK. Thought so. Tried it but MATLAB did not capture the data. Well, now I know at least that I have to look at that end.

Cheers,

Geert