Author Topic: Problem with EXIF  (Read 4185 times)

0 Members and 1 Guest are viewing this topic.

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Problem with EXIF
« on: October 04, 2008, 06:25:06 AM »
Hi there,
I have one small problem with exif on my website.
I'm starting taking pictures with longer exposure time like 1 second and right now my exif script doesn't know how to show this information correctly. So can somebody help my with that?
Here is how actually my script looks like

Code: [Select]
case "ExposureTime":
      $valpieces = explode("/",$val);
      $val = round(($valpieces[1] / $valpieces[0]), 0);
      $val = "1/" . $val . " seconds";
      break;

With this code all photos taken with longer exposure time like 1s is showed like 1/0s
I try to use old code for this value

Code: [Select]
case "ExposureTime":
       $val = $val . " seconds";
       break;

but then my exposure time was show in not right and easy understandable format like this 100/1192
in this case right time was 119.2 second

so its something what I can do with that?
Thanks to everybody for help.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Problem with EXIF
« Reply #1 on: October 04, 2008, 06:52:00 AM »
This should do it:
case "ExposureTime":
        
$valpieces explode("/",$val);
        if (
$valpieces[0] > && $valpieces[1] > 0)
          
$e $valpieces[0] / $valpieces[1];
        else
          
$e $val;
        if (
$e && $e 0)
          
$val "1/" round($e0);
        else
          
$val round($e1);
        
$val .= " seconds";
      break;


(not tested)
« Last Edit: October 04, 2008, 08:57:32 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: Problem with EXIF
« Reply #2 on: October 04, 2008, 04:04:25 PM »
HI V@no thanks for help.

with your code long time exposures are shown like 1/119 second (original 119.2 second) and short time exposures (under 1 sec) 350 second and should be 1/350 sec.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Problem with EXIF
« Reply #3 on: October 04, 2008, 05:57:23 PM »
Ops. wrong one line...should work now.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Rembrandt

  • Guest
Re: Problem with EXIF
« Reply #4 on: October 04, 2008, 07:38:00 PM »
Hi!
.....
Quote
case "ExposureTime":
$exposure_time=explode("/",$val);
if ($exposure_time[0]>0)  {
$exposure_time[1] = round($exposure_time[1]/$exposure_time[0]);
$exposure_time[0] = $exposure_time[0]/$exposure_time[0];}
$val = $exposure_time[0]."/".$exposure_time[1]." seconds";
break;

mfg Andi


Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: Problem with EXIF
« Reply #5 on: October 05, 2008, 12:28:25 AM »
Ops. wrong one line...should work now.

Right now is working great, thanks a lot V@no.
« Last Edit: October 05, 2008, 04:46:47 PM by om6acw »

 

Post your comments here