Liberty BASIC Community Forum
« Reading digital camera EXIF data »

Welcome Guest. Please Login or Register.
Dec 13th, 2017, 12:50pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Reading digital camera EXIF data  (Read 2074 times)
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1170
xx Reading digital camera EXIF data
« Thread started on: Aug 26th, 2016, 3:19pm »

Someone raised this on the forum and it encouraged me to have a play.
Many modern cameras store the image, a thumbnail version, and technical information BUT the format is 'flexible' and interpreted differently sometimes, and not always handled correctly when you edit the photo.
After a quick Google search I decided it was easiest to reverse-engineer some of my own photos. A hex editor showed where the plain-text xml data section was and I ended with this code.
No guarantee it will work on your camera. And photo-processors like The Gimp display the data anyway.
However it's got me thinking on a bit of data analysis and statistics- I've 16000 photos on Flickr to play with!
Code:
    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"
 

OUTPUT on one of my trusty old cameras..
Code:
Make>                             = EASTMAN KODAK COMPANY
Model>                            = KODAK DX7590 ZOOM DIGITAL CAMERA
Orientation>                      = Top-left
XResolution>                      = 230
YResolution>                      = 230
ResolutionUnit>                   = Inch
DateTime>                         =
YCbCrPositioning>                 = Centred
Copyright>                        =
Compression>                      = JPEG compression
XResolution>                      = 230
YResolution>                      = 230
ResolutionUnit>                   = Inch
ExposureTime>                     = 1/1000 sec.
FNumber>                          = f/5.0
ISOSpeedRatings>                  =
ExifVersion>                      = Exif Version 2.21
DateTimeOriginal>                 = 2015:11:14 06:32:11
CompressedBitsPerPixel>           =
ShutterSpeedValue>                = 9.90 EV (1/955 sec.)
ApertureValue>                    = 4.60 EV (f/4.9)
ExposureBiasValue>                = 0.00 EV
MaxApertureValue>                 = 3.50 EV (f/3.4)
MeteringMode>                     = Pattern
 
User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1708
xx Re: Reading digital camera EXIF data
« Reply #1 on: Aug 27th, 2016, 2:25pm »

doesn't work for Canon sad
(a510 and IXUS230)
User IP Logged

damned Dog in the Manger
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls