Using camera image EXIF data

- -

Digital cameras and smartphones add technical data to the actual image pixels of their jpg files- info. about the camera and the exposure, orientation, resolution, etc.

I'd previously written software to display that data for one of my older cameras ( different ones use different formats and are often effectively indecipherable since the data is held in indexed location in the file with unknown data formats). GPS enabled devices for example include it in the EXIF section- useful if searching for pictures taken at specific locations or regions. But if you store your photos in the cloud this means the storage company can mine the metadata from the EXIF to find where you've been and what kind of things you've been photographing. And with their powerful image-recognition powers, who you've been meeting!

But then I found a real situation where I NEEDED the data, rather than just being interested in what was there, because after accidentally overwriting the index directory, thousands of files were recoverable by recovery software ( since not over written)- but all the names and dates had gone. I was working in Linux and had accidentally written a 4G Raspberry Pi image to the start of my 2TB server hdd!!

I adapted the existing demo ( below) to rename them all with the EXIF date as part of the name- now I could at least associate together photos taken on the same date. ( Incidentally it is of course easy to alter the date etc and rewrite the file)



    filedialog "Input JPG", "*.jpg", fn;

    open fn; for input as #inFile
        c; =input;( #inFile, lof( #inFile))
    close #inFile

    while datum; <>"999"
        read datum; 
        if datum; ="999" then wait
        strt        =instr( c;, datum;) +len( datum;)
        fin         =instr( c;, "</" +mid;( datum;, 2))

        dAbbrv;     =mid;( datum;, 7)
        value;      =mid;( c;, strt, fin -strt)
        if instr( value;, "<rdf") then value; =""
        print dAbbrv;; tab( 35); "= "; value;
    wend

    wait

    end

data "<exif:Make>"
data "<exif:Model>"
data "<exif:Orientation>"
data "<exif:XResolution>"
data "<exif:YResolution>"
data "<exif:ResolutionUnit>"
data "<exif:DateTime>"
data "<exif:YCbCrPositioning>"
data "<exif:Copyright>"
data "<exif:Compression>"
data "<exif:XResolution>"
data "<exif:YResolution>"
data "<exif:ResolutionUnit>"
data "<exif:ExposureTime>"
data "<exif:FNumber>"
data "<exif:ISOSpeedRatings>"
data "<exif:ExifVersion>"
data "<exif:DateTimeOriginal>"
data "<exif:CompressedBitsPerPixel>"
data "<exif:ShutterSpeedValue>"
data "<exif:ApertureValue>"
data "<exif:ExposureBiasValue>"
data "<exif:MaxApertureValue>"
data "<exif:MeteringMode>"
DATA "999"