Author Topic: [MOD] Exif V.1.7.6  (Read 189354 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #60 on: October 20, 2009, 08:34:16 PM »
It seems this mod only updates database via ACP
to time yes, but next week would i add a member plugin

mfg Andi

Offline apaunganhote

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #61 on: October 21, 2009, 02:54:50 AM »
V@no and Andi,

Thanks much! I will be looking forward to have member functions :)

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #62 on: October 25, 2009, 06:55:44 PM »
Hi!
....
I will be looking forward to have member functions :)

DONE, and many code updates and new files.

mfg Andi

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Exif V.1.7.6
« Reply #63 on: March 23, 2010, 07:05:02 PM »
Guys!

Thanks for a great mod.

I am trying to get away from ImageMagic since one image out of 100 hangs my server.... nobody knows why.
It works fine with GD... but the EXIF is gone then... and it's important for me.

So I have decided to install this MOD on my 1.7.7 .... and have a few problems with it:

1. The headings are not being picked up correctly in the EXIF block... plus the columns are shifted be one line ... see attached image.
2. I am using the auto resize mod as well and I thought if I put the EXIF mod code before the auto-resizer in member.php, it would pick up the info and save it in the database... but it does not... it only works with ImageMagic and not working with GD...... what am I missing?

Thanks for any hints in advance.
« Last Edit: March 23, 2010, 07:43:51 PM by alekseyn1 »

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #64 on: March 24, 2010, 05:42:30 AM »
Hi!

in your example the field name is not right.
the fieldname are original, without "image_"
I miss the field "make" at the top

mfg Andi

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Exif V.1.7.6
« Reply #65 on: March 24, 2010, 02:40:29 PM »
Hi!

in your example the field name is not right.
the fieldname are original, without "image_"
I miss the field "make" at the top

mfg Andi

Thanks Rembrandt for your answer.

My problem is that this part of the code does not work for some reason:

Code: [Select]
             "exif_name" => $lang['exif_'.$key],
if I just do

Code: [Select]
             "exif_name" => $key,
Then all is fine but in english language... and even the shifting is gone.... but if I keep the original code the same situation as indicated in my previous post attachment....

 :? :? :?

Offline alekseyn1

  • Full Member
  • ***
  • Posts: 102
    • View Profile
    • My Project
Re: [MOD] Exif V.1.7.6
« Reply #66 on: May 30, 2010, 03:56:18 PM »
1. The headings are not being picked up correctly in the EXIF block... plus the columns are shifted be one line ... see attached image.

Ok, this problem is fixed by making some code entries (step 3 and 4... for some reason $lang variable was not being picked up when uppercase characters were present) in lowercase and modifying the code in functions.php like so (step 2):

Code: [Select]
if ($detailed_view && $image_info[2] == 2){
       global $site_db,$lang;

$sql = "SELECT image_make, image_model, image_datetimeoriginal, image_isospeedratings, image_exposuretime, image_fnumber, image_focallength, image_exposurebiasvalue, image_aperturevalue, image_maxaperturevalue,
                 image_meteringmode, image_flash, image_exposureprogram, image_exposuremode, image_whitebalance, image_gpslatitude, image_gpslatituderef, image_gpslongitude, image_gpslongituderef, image_gpsaltitude,
                 image_gpstrack
                 FROM ".IMAGES_TABLE."
                 WHERE image_id = '$image_id'";

$result = $site_db->query($sql);

$row = mysql_fetch_object($result);   

$bgcounter = 0;
         
 foreach ($row as $key => $val) {             

if ($val != "") {

$key = str_replace('image_','',$key);

          if (($key != "gpslongituderef") &&  ($key != "gpslatituderef")) {
          if ($key == "gpslongitude") {
$GPSLongtude = substr (strrchr($val, "("), 1);
$GPSLongtude = substr ($GPSLongtude,0, strlen($GPSLongtude)-1);
}
          if ($key == "gpslatitude") {
$GPSLatitude = substr (strrchr($val, "("), 1);
$GPSLatitude = substr ($GPSLatitude,0, strlen($GPSLatitude)-1);


        $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
            $site_template->register_vars(array(
               "exif_value" => format_text($val, 1),
               "exif_name" => $lang['exif_'.$key],
   "row_bg_number" => $row_bg_number
            ));
            $exif_info2 .= $site_template->parse_template("exif_bit");
           } // GPS
          } //end val
        }  // end foreach
     } // Exif aus DB
 }
}
//################################# End Exif aus DB #################################################################

Offline SaFo

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #67 on: June 02, 2010, 10:14:45 AM »
Hallo Andi,

ich habe die Änderungen nun wie hier beschrieben durchgeführt, hochgeladen und habe dann die install_exif.php ausgeführt. Dann kam folgende Fehlerfeldung:

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /pages/09/01/d0012773/home/htdocs/www/dfrsd.de/bilderarchiv/includes/functions.php on line 703

Hier ist der Code aus dieser Zeile:
Code: [Select]
     "media_src" => $media_src,

Was könnte dies sein?

Als Anhang die functions.php

Grüße
Safo

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #68 on: June 03, 2010, 05:48:36 PM »
dein fehler ist in zeile 702:
//################################# End Exif aus DB #############################    $site_template->register_vars(array(
      
"media_src" => $media_src,

das muss so lauten:
//################################# End Exif aus DB #############################    
$site_template->register_vars(array(
      
"media_src" => $media_src,


mfg Andi

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #69 on: December 07, 2010, 11:45:54 AM »
Hallo
...
und für den neuen mod exif V 1.7.6
Quote
elseif ($key == "ExposureTime") {
$ExposureTime = explode("/", $exif_info);
if(($ExposureTime[0] == 1) & ($ExposureTime[1] == 1) ){
$exif_array[$exif_match[$key]] = $ExposureTime[1]." Sekunde";
}
elseif(($ExposureTime[0] == 1)){
$exif_array[$exif_match[$key]] = "1/".($ExposureTime[1] * $ExposureTime[0])." Sekunde";
}
 elseif(($ExposureTime[1] > 1)){
$exif_array[$exif_match[$key]] = ($ExposureTime[0]/$ExposureTime[1])." Sekunden";
}
elseif(($ExposureTime[1] ==1 )){
$exif_array[$exif_match[$key]] = ($ExposureTime[0] * $ExposureTime[1])." Sekunden";
}
}

vielleicht könnt ihr das bitte nochmal testen.
ich krame das nochmals raus, denn einige Werte bleiben bei mir in der Darstellung falsch.
Betrifft aktuell Zeiten von 1/30,  1/60 und

In den Variablen $ExposureTime[0] wird eine 10, in $ExposureTime[1] eine 600 eingelesen und das Ergebnis wird 0.016666666666667.
Exifer, xnview etc. weisen 1/60 aus.

Ich habe mir mal in die "Update_EXIF_Index.php" einige Ausgaben notiert und dann sieht das bspw. so aus:
Code: [Select]
25
1000
0.025 sec(s)
125
10000
0.0125 sec(s)
10
300
0.033333333333333 sec(s)
10
600
0.01666666666666 sec(s)
10
40
0.25 sec(s)
1
100
1/100 sec(s)
10
50
0.2 sec(s)
$ExposureTime[0]
$ExposureTime[1]
$exif_array[$exif_match[$key]]

Gebe gern Zugriff auf die Seite oder weiteres per PN bzw. hier.
Hatte mir schon händisch einige "Brücken" für 10/300 etc. gebastelt, aber IMO macht das so ja keinen Sinn  :|

Danke!
Henry


Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #70 on: December 07, 2010, 02:36:31 PM »
...
wie stehen den bei den betreffenden bilder die werte in der DB, als dezimal oder als bruch?

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #71 on: December 07, 2010, 02:58:48 PM »
Hallo Andi,
wie stehen den bei den betreffenden bilder die werte in der DB, als dezimal oder als bruch?
je nachdem  :| siehe Screen unten.

Habe mir die in der functions.php stehenden Eventualitäten für "ExposureTime" auch mal mit auswerfen lassen (mit a, b, c ...)
Code: [Select]
        elseif ($key == "ExposureTime") {
                $ExposureTime = explode("/", $exif_info);
echo "<br>".$ExposureTime[0]." ";
echo "<br>".$ExposureTime[1]." ";
        if(($ExposureTime[0] == 1) & ($ExposureTime[1] == 1) ){
            $exif_array[$exif_match[$key]] = $ExposureTime[1]." Sekunde";
echo "<br>a<br>".$exif_array[$exif_match[$key]];
            }
        elseif(($ExposureTime[0] == 1)){
                $exif_array[$exif_match[$key]] = "1/".($ExposureTime[1] * $ExposureTime[0])." Sekunde";
echo "<br>b<br>".$exif_array[$exif_match[$key]];
                }
        elseif(($ExposureTime[1] > 1)){
                $exif_array[$exif_match[$key]] = ($ExposureTime[0]/$ExposureTime[1])." Sekunden";
echo "<br>c<br>".$exif_array[$exif_match[$key]];
                }
        elseif(($ExposureTime[1] == 1 )){
                $exif_array[$exif_match[$key]] = ($ExposureTime[0] * $ExposureTime[1])." Sekunden";
echo "<br>d<br>".$exif_array[$exif_match[$key]];
                }

        }

 und es wird auch insoweit die richtige elseif-Bedingung verwendet.

Danke!
Henry

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #72 on: December 07, 2010, 03:11:53 PM »
da stimmen aber einige belichtungszeiten nicht.
lösche einmal manuel bei einem der betreffenden bilder die belichtungszeit, und führe danach die exif_rebuild nochmal aus.
das muß als bruch drinnen stehn und nicht als dezimalzahl.

Offline henary

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #73 on: December 07, 2010, 03:33:17 PM »
Hallo Andi,
da stimmen aber einige belichtungszeiten nicht.
lösche einmal manuel bei einem der betreffenden bilder die belichtungszeit, und führe danach die exif_rebuild nochmal aus.
das muß als bruch drinnen stehn und nicht als dezimalzahl.
:?
Habe Deine Schritte gemacht, aber genau das ist doch das Problem: weder im Checkimages, noch mittels des exif_rebuild werden die Daten korrekt ermittelt. Ich füge mal eines der Bilder (nur die Größe reduziert) im Original an. Meine aktuelle functions.php auch

Bis gleich & Danke,
Henry


Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #74 on: December 07, 2010, 03:46:41 PM »
@henary, ich denke da ist ein fehler drinnen, nur verstehe ich nicht warum mir das nie aufgefallen ist b.z.w. warum der fehler bei all meinen galerien nie aufgetaucht ist.
oder mir ist bei all dem copy&paste was verloren gegangen.  :?

so ich habe vorerst einmal eine lösung,
 ich würde dich bitten diese änderung einmal durchzuführen, und danach die rebuild exif nochmals auszuführen.
suche in den code:
       elseif(($ExposureTime[0] == 1)){ 
                
$exif_array[$exif_match[$key]] = "1/".($ExposureTime[1] * $ExposureTime[0])." sec(s)"
                }

und füge darunter ein:
	
	
	
 elseif((
$ExposureTime[0] > 1)){ 
                
$exif_array[$exif_match[$key]] = "1/".round($ExposureTime[1]/$ExposureTime[0])." sec(s)"
                }


passieren kann nichts ausser das es vielleicht woanders dann hakt.

mfg Andi


edit: eh klar eine nikon, (nur probleme)  :mrgreen:
dürfte tatsächlich ein unterschied zw. den herstellern geben, in meiner galerie sind alle werte korrekt eingetragen.
« Last Edit: December 07, 2010, 03:59:37 PM by Rembrandt »