Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.