rwcarlsen / goexif

Decode embedded EXIF meta data from image files.
BSD 2-Clause "Simplified" License
627 stars 134 forks source link

How to get Aperture #41

Closed zepouet closed 9 years ago

zepouet commented 9 years ago

Hello,

Sorry to open a ticket for this question but I am lost. I am reading exif specification to calculate FStop but I am wrong...

aperture, _ := x.Get(exif.ApertureValue) 
numer, denom, _ = aperture.Rat2(0) 
fmt.Printf("\n%v", ...) 

No way to calculate it. Do you have any idea to convert A / B to a readable F-STOP ?

Thanks a lot ! Best regards,

rwcarlsen commented 9 years ago

You probably want the FNumber tag.

rwcarlsen commented 9 years ago

The exifstat command (go get github.com/rwcarlsen/goexif/exifstat) can print off all of the tags found in the image:

$ exifstat foo.jpg

---- Image 'foo.jpg' ----
    YCbCrPositioning: [2]
    ThumbJPEGInterchangeFormat: [10924]
    SubSecTimeOriginal: "64"
    GPSVersionID: [2,3,0,0]
    DateTime: "2015:02:21 14:48:27"
    Artist: ""
    GPSInfoIFDPointer: [9034]
    ISOSpeedRatings: [100]
    InteroperabilityIFDPointer: [8806]
    FocalPlaneXResolution: ["5184000/894"]
    CustomRendered: [0]
    UserComment: ""
    Make: "Canon"
    ExposureTime: ["1/200"]
    FNumber: ["18/10"]
    DateTimeOriginal: "2015:02:21 14:48:27"
    ExposureBiasValue: ["0/1"]
    MeteringMode: [5]
    Flash: [16]
    ApertureValue: ["106496/65536"]
    SubSecTime: "64"
    SubSecTimeDigitized: "64"
    PixelYDimension: [3456]
    ExposureMode: [0]
    InteroperabilityIndex: "R98"
    FocalPlaneResolutionUnit: [2]
    ResolutionUnit: [2]
    ExifIFDPointer: [360]
    ThumbJPEGInterchangeFormatLength: [13501]
    ComponentsConfiguration: ""
    FocalLength: ["50/1"]
    ColorSpace: [1]
    FocalPlaneYResolution: ["3456000/597"]
    Model: "Canon EOS REBEL T4i"
    XResolution: ["72/1"]
    DateTimeDigitized: "2015:02:21 14:48:27"
    WhiteBalance: [0]
    SceneCaptureType: [0]
    PixelXDimension: [5184]
    Orientation: [1]
    YResolution: ["72/1"]
    Copyright: ""
    ExifVersion: "0230"
    ShutterSpeedValue: ["499712/65536"]
    MakerNote: ""
    FlashpixVersion: "0100"
    ExposureProgram: [3]

This could maybe help you find the tag/info you are looking for.

zepouet commented 9 years ago

Hello,

Thanks you very much for your help. It is nice.

Do you know if images coming from Sony Alpha or other manufacturer will have problem to be decoded ? Is exif a specification or it must be adapted to differents origins ?

Best regards, Nicolas