Jump to content

Shutter speed conversion...


foucquet

Recommended Posts

When pulling exif data from an image I have pretty much everythiung nailed down except for the Shutter Speed value. When pulled from the image this is returned as:-

 

'Shutter' => string '0.0015625'

 

Now I know that the actual shutter speed at the time of shooting was 1/640 sec; does anyone have any ideas about how one would convert... 'Shutter' => string '0.0015625' to 1/640 sec... I have been scratching my head over this problem for a few days now and am stiull no wiser  >:(  >:(  >:(

Link to comment
https://forums.phpfreaks.com/topic/252994-shutter-speed-conversion/
Share on other sites

To get "around" the binary math problem of close-enough. You can use the BC Math extension. Be sure though that the number is always a string both when storing (or use DECIMAL if your precision is smaller than 65) and manipulating or your result may be off:

 

$var = bcdiv(1, '0.0015625'); // note the quotes 

Thanks for all of the suggestions, in the end I used the PHP exif_read_data() function (don't know why I didn't think of it in the first place  :confused:) rather than the inbuilt Wordpress function, the PHP function actually returns the exif data as wanted except that one then has to split the DateTime into two variables rather than the one returned, but that's simple  :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.