4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Rembrandt on April 22, 2011, 06:25:30 PM

Title: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on April 22, 2011, 06:25:30 PM
Hi!

Für V1.7.10 oder höher.

Dieser MOD erweitert die in der Version 1.7.10 enthaltene IPTC funktion um folgendes:

Alle IPTC Daten der Bilder, werden ausgelesen und in die Datenbank geschrieben.
Dadurch können Bilder nach IPTC Daten gesucht werden.

Zu Modifizierenden Dateien:
 1.) SQL Table "wordmatch","images" und "images_temp" erstellen.
       (im Anhang befindet sich die install_iptc.php um die benötigten Datenbankfelder automatisch anzulegen.)
 2.) admin/checkimages.php
 3.) includes/db_field_definitions.php
 4.) includes/functions.php
 5.) root/config.php
 6.) IPCT Daten der Bilder in die Datenbank schreiben.
 7.) OPTIONAL Member Addon: IPTC Daten werden auch in die Datenbank geschrieben, wenn die Bilder über das Member Uploadformular hoch geladen werden.  

Codeupdate: step 5.) 23.06.2011
Codeupdate: step 7.); 7.1); 7.2); 7.3); 8.);  19.07.2011



1.) kopiert die "install_iptc.php" aus dem anhang in euren root und ruft sie auf.

2.) suche in der admin/checkimage.php:

$sql = "INSERT INTO ".IMAGES_TABLE."

füge  darüber ein:  /insert above:

//############################### Start IPTC ############################################
            $src_file = ($big_file) ? MEDIA_PATH."/".$cat_id."/".$big_folder."/".$big_file : $file;
            $size = getimagesize ($src_file, $info);
              if(isset($info['APP13'])){
                $iptc_array = get_iptc_info($info['APP13']);
                foreach ($iptc_array as $key => $val) {
                  $additional_field_sql .= ',image_'.$key;
                  $additional_value_sql .= ",'".addslashes($val)."'";
                }
              }
//############################### End IPTC ##############################################

2.1) suche: /search:

add_searchwords($image_id, $search_words);

füge darunter ein:  /insert below:

//################################## Start Exif IPTC  #########################
          $sql = "SELECT image_id".$additional_field_sql."
                  FROM ".IMAGES_TABLE."
                  WHERE image_id = $image_id
                  ";
          $result = $site_db->query($sql);
          while ($row = $site_db->fetch_array($result)) {
            $additional_search_words = array();
            foreach ($search_match_fields as $image_column => $match_column) {
              if (isset($row[$image_column])) {
                $additional_search_words[$image_column] = $row[$image_column];
              }
            }
            add_searchwords($image_id, $additional_search_words);
          };
//################################## End Exif IPTC ##########################


3.)  suche in der includes/db_field_definition.php

?>

füge darüber ein: /insert above:

//################################ Start Iptc ##############################################  
$additional_image_fields['image_caption'] = array($lang['iptc_caption'], "text", 0);                        
$additional_image_fields['image_caption_writer'] = array($lang['iptc_caption_writer'], "text", 0);                
$additional_image_fields['image_headline'] = array($lang['iptc_headline'], "text", 0);                      
$additional_image_fields['image_special_instructions'] = array($lang['iptc_special_instructions'], "text", 0);          
$additional_image_fields['image_byline']  = array($lang['iptc_byline'], "text", 0);                        
$additional_image_fields['image_byline_title'] = array($lang['iptc_byline_title'], "text", 0);                  
$additional_image_fields['image_credit'] = array($lang['iptc_credit'], "text", 0);                        
$additional_image_fields['image_source'] = array($lang['iptc_source'], "text", 0);                        
$additional_image_fields['image_object_name'] = array($lang['iptc_object_name'], "text", 0);                    
$additional_image_fields['image_date_created'] = array($lang['iptc_date_created'], "text", 0);                  
$additional_image_fields['image_city'] = array($lang['iptc_city'], "text", 0);                          
$additional_image_fields['image_state'] = array($lang['iptc_state'], "text", 0);                          
$additional_image_fields['image_country'] = array($lang['iptc_country'], "text", 0);                        
$additional_image_fields['image_original_transmission_reference'] = array($lang['iptc_original_transmission_reference'], "text", 0);
$additional_image_fields['image_category'] = array($lang['iptc_category'], "text", 0);
$additional_image_fields['image_supplemental_category'] = array($lang['iptc_supplemental_category'], "text", 0);                      
$additional_image_fields['image_keyword'] = array($lang['iptc_keyword'], "text", 0);                        
$additional_image_fields['image_copyright_notice'] = array($lang['iptc_copyright_notice'], "text", 0);              
//############################ End IPTC ###############################################################


4.)  suche in der includes/functions.php: /search in includes/functions.php:

        if ($detailed_view && isset($info['APP13'])) {
          $iptc_array = get_iptc_info($info['APP13']);
          $bgcounter = 0;
          foreach ($iptc_array as $key => $val) {
            $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
            $site_template->register_vars(array(
              "iptc_value" => format_text($val),
              "iptc_name" => $lang['iptc_'.$key],
              "row_bg_number" => $row_bg_number
            ));
            $iptc_info .= $site_template->parse_template("iptc_bit");
          }
        }

und ersetze es mit: /and replace:

 //############################ IPTC Start ##################################
        if ($detailed_view ) {
          global $site_db,$lang,$additional_image_fields,$search_index_types;
          $additional_field_sql = "";
          foreach ($additional_image_fields as $key => $val){
            $additional_field_sql .= ','.$key;
          }
          $sql = "SELECT image_id".$additional_field_sql."
                  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 != "") {
              $search_key = $key;
              $key = str_replace('image_','',($key));
              
              if(($search_index_types[$search_key]) == 'keywords'){
                $split_keyword = explode(",", $val);
                array_walk($split_keyword, 'trim_value');
                $keyword = "";
                foreach ($split_keyword as $val) {
                  $url_val = $val;
                     if (strpos($url_val, ' ') !== false) {
                      $url_val = '"' . $url_val . '"';
                    }
                    $keyword.= (($keyword != "") ? ", " :"")."<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($url_val))."&amp;search_fields=$search_key \">".format_text($val, 2)."</a>";
                }
                $val = $keyword;
              }
              
              if(($search_index_types[$search_key]) == 'phrase'){
                $url_val = '"' . $val . '"';
                $val= "<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($url_val))."&amp;search_fields=$search_key \">".format_text($val, 2)."</a>";
              }
              
              if(($search_index_types[$search_key]) == 'fulltext'){
                $val= format_text($val, 2);
              }
              
              if (isset($lang['iptc_'.$key])) {
                $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
                $site_template->register_vars(array(
                  "iptc_value" => $val,
                  "iptc_name" => $lang['iptc_'.$key],
                  "row_bg_number" => $row_bg_number
                ));
                $iptc_info .= $site_template->parse_template("iptc_bit");
              }
            }
          }
        }
//############################## IPTC END ###################################


5.) suche in der root/config.php:    /search in root/config.php:

?>

füge davor ein: /insert above:

  $search_index_types = array(
    "image_id" => "phrase",
    "image_name" => "fulltext",
    "image_description" => "fulltext",
    "image_keywords"    => "keywords",
    "image_caption" => "fulltext",
    "image_caption_writer" =>"phrase",
    "image_headline" =>"phrase",
    "image_special_instructions" =>"fulltext",
    "image_byline" =>"phrase",
    "image_byline_title" =>"phrase",
    "image_credit" =>"phrase",
    "image_source" =>"phrase",
    "image_object_name" =>"keywords",
    "image_date_created" =>"phrase",
    "image_city" =>"phrase",
    "image_state" =>"phrase",
    "image_country" =>"phrase",
    "image_original_transmission_reference" =>"phrase",
    "image_category" =>"phrase",
    "image_supplemental_category" =>"phrase",
    "image_keyword" =>"keywords",
    "image_copyright_notice" =>"fulltext",
  );

  $search_match_fields = array(
    "image_name"  => "name_match",
    "image_description" => "desc_match",
    "image_keywords" => "keys_match",
    "image_caption" =>"caption_match",
    "image_caption_writer" =>"caption_writer_match",
    "image_headline" =>"headline_match",
    "image_special_instructions" =>"special_instructions_match",
    "image_byline" =>"byline_match",
    "image_byline_title" =>"byline_title_match",
    "image_credit" =>"credit_match",
    "image_source" =>"source_match",
    "image_object_name" =>"object_name_match",
    "image_date_created" =>"date_created_match",
    "image_city" =>"city_match",
    "image_state" =>"state_match",
    "image_country" =>"country_match",
    "image_original_transmission_reference" =>"original_transmission_reference_match",
    "image_category" =>"category_match",
    "image_supplemental_category" =>"supplemental_category_match",
    "image_keyword" =>"keyword_match",
    "image_copyright_notice" =>"copyright_notice_match"
  );
 

6.)  Kopiert die Datei "create_iptc_data.php" (im Anhang) nach admin/plugins und führ sie 1x aus.
    Mit dieser Datei werden die schon vorhanden Bilder der Galerie nach IPTC Daten durchsucht und in die Datenbank geschrieben.
   Falls ihr schon IPTC Daten in der Datenbank habt braucht ihr diesen schritt nicht durchführen.


OPTIONAL Member Addon: IPTC Daten werden auch in die Datenbank geschrieben, wenn die Bilder über das Member Uploadformular hoch geladen werden.

7.)  suche in der member.php abschnitt($action == "editimage"):
search in member.php section($action == "editimage"):    

  $txt_clickstream = get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".format_text($image_row['image_name'], 2)."</a>".$config['category_separator'];

füge darüber ein:
inser above:

//######################### IPTC EXIF #########################################  
  foreach ($image_row as $key => $val) {
    if ($val && (!is_numeric($key))) {
    $hidden_fields .= "<input type=\"hidden\" name=\"$key\" value=\"$val\" />\n";
    }
  }
//######################### IPTC EXIF #########################################

7.1) suche in der member.php abschnitt($action == "editimage"):
search in member.php section($action == "editimage"):

$site_template->register_vars(array(

füge darunter ein:
insert below:

    "hidden_fields" => $hidden_fields, //########## IPTC EXIF ################

7.2) suche:
   search:

$table = ($direct_upload) ? IMAGES_TABLE : IMAGES_TEMP_TABLE;

füge darüber ein:
insert above:

//############################### Start IPTC ############################################
      $src_file = $src;
      $size = getimagesize ($src_file, $info);
        if(isset($info['APP13'])){
          $iptc_array = get_iptc_info($info['APP13']);
          foreach ($iptc_array as $key => $val) {
            $additional_field_sql .= ',image_'.$key;
            $additional_value_sql .= ",'".$val."'";
          }
        }
//############################### End IPTC #############################################

7.3) suche:
search:

          }
          add_searchwords($image_id, $search_words);

füge darunter ein:
insert below:

//######################### Start Exif IPTC  #########################
          $sql = "SELECT image_id".$additional_field_sql."
                  FROM ".IMAGES_TABLE."
                  WHERE image_id = $image_id
                  ";
          $result = $site_db->query($sql);
          while ($row = $site_db->fetch_array($result)) {
            $additional_search_words = array();
            foreach ($search_match_fields as $image_column => $match_column) {
              if (isset($row[$image_column])) {
                $additional_search_words[$image_column] = $row[$image_column];
              }
            }
            add_searchwords($image_id, $additional_search_words);
          };
//####################### End Exif IPTC #########################


8.) suche in templates/yourTemplates/member_editimage.html:
Code: [Select]
<form method="post" action="{url_member}" onsubmit="uploadbutton.disabled=true;">
füge darunter ein:
insert below:
Code: [Select]
{hidden_fields}

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Lunis on July 19, 2011, 08:45:19 AM
Help :(

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /pub/home/kurzeme6/htdocs/admin/checkimages.php on line 572
(http://www.fotoklubsogre.lv/draz/ERROR.jpg)
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on July 19, 2011, 09:06:21 AM
Welcome to the Forum!

......

Post your "checkimages.php" and not a image
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Lunis on July 19, 2011, 09:32:18 AM
O.k post "checkimages.php"  checkimages_bad.zip http://www.fotoklubsogre.lv/draz/checkimages_bad.zip (http://www.fotoklubsogre.lv/draz/checkimages_bad.zip)
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on July 19, 2011, 09:35:03 AM
füge darüber ein =>  insert above
füge darunter ein => insert below

mfg Andi

Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Lunis on July 19, 2011, 10:13:10 AM
füge darüber ein =>  insert above
füge darunter ein => insert below

where it is to write??
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on July 19, 2011, 10:23:05 AM
this is your code:

                 if (!$error_major)
                 {
                    $sql = "INSERT INTO ".IMAGES_TABLE."
                   
//############################### Start IPTC ############################################
            $src_file = ($big_file) ? MEDIA_PATH."/".$cat_id."/".$big_folder."/".$big_file : $file;
            $size = getimagesize ($src_file, $info);
              if(isset($info['APP13'])){
                $iptc_array = get_iptc_info($info['APP13']);
                foreach ($iptc_array as $key => $val) {
                  $additional_field_sql .= ',image_'.$key;
                  $additional_value_sql .= ",'".$val."'";
                }
              }
//############################### End IPTC ##############################################
                                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments".$additional_field_sql.")
                                VALUES
                                ($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $image_date, $image_active, '".addslashes($image_media_file)."', '".addslashes($image_thumb_file)."', '$image_download_url', $image_allow_comments".$additional_value_sql.")";


you have the code step 2.) insert below
$sql = "INSERT INTO ".IMAGES_TABLE."

please read step 2.) again (above)
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Lunis on July 19, 2011, 10:46:41 AM
O.k , Thanks I will try.
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Lunis on July 21, 2011, 04:39:07 PM
Opss Ops ops next Error: (


Warning: rename(kuldiga_2011_0001_TESTS.jpg,kuldiga_2011_0001_tests.jpg): Permission denied in /pub/home/kurzeme6/htdocs/admin/checkimages.php on line 203

Warning: imagejpeg(): Unable to open './../data/thumbnails/26/kuldiga_2011_0001_TESTS.jpg' for writing in /pub/home/kurzeme6/htdocs/includes/image_utils.php on line 93

DB Error: Bad SQL Query: INSERT INTO 4images_images (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments,image_byline,image_copyright_notice) VALUES (26, 1, 'kuldiga 2011 0001 TESTS', '', '', UNIX_TIMESTAMP('2011-07-21 17:39:53'), 1, 'kuldiga_2011_0001_TESTS.jpg', '', '', 0,'Photographer: Ieva Purina','Copyright: Latvianphoto.com')
Unknown column 'image_byline' in 'field list'
Working on data/media/26/kuldiga_2011_0001_TESTS.jpg file
Error renaming media file from kuldiga_2011_0001_TESTS.jpg to kuldiga_2011_0001_tests.jpg
Error creating thumbnail.
Error adding image.


Warning: imagejpeg(): Unable to open './../data/thumbnails/26/kuldiga_2011_0049.jpg' for writing in /pub/home/kurzeme6/htdocs/includes/image_utils.php on line 93

DB Error: Bad SQL Query: INSERT INTO 4images_images (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments,image_caption,image_byline,image_byline_title,image_keyword,image_copyright_notice) VALUES (26, 1, 'kuldiga 2011 0049', 'Dzires Kuldiga , city festival A Feast in Kuldîga', 'Dzires Kuldiga,city festival,A Feast in Kuldîga', UNIX_TIMESTAMP('2011-07-21 17:39:53'), 1, 'kuldiga_2011_0049.jpg', '', '', 0,'Dzires Kuldiga , city festival „A Feast in Kuldîga”','Photographer: Rihards Purins','Dzires Kuldiga 2011','Dzires Kuldiga, city festival, A Feast in Kuldîga”','Copyright: Latvianphoto.com')
Unknown column 'image_caption' in 'field list'
Working on data/media/26/kuldiga_2011_0049.jpg file
Error creating thumbnail.
Error adding image.

No new images added!
------------------------------------------------------------------------------
Error php , http://www.ogresbalss.lv/bacc/Error_php.zip
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on July 21, 2011, 05:40:05 PM
Warning: rename(kuldiga_2011_0001_TESTS.jpg,kuldiga_2011_0001_tests.jpg): Permission denied in /pub/home/kurzeme6/htdocs/admin/checkimages.php on line 203
Warning: imagejpeg(): Unable to open './../data/thumbnails/26/kuldiga_2011_0001_TESTS.jpg' for writing in /pub/home/kurzeme6/htdocs/includes/image_utils.php on line 93
...Warning: imagejpeg(): Unable to open './../data/thumbnails/26/kuldiga_2011_0049.jpg' for writing in /pub/home/kurzeme6/htdocs/includes/image_utils.php on line 93
....
please read /docs/Installation.english.txt step 5.)
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: clubbu on July 22, 2011, 12:17:40 PM
hello, I do not know what to serve this mod. What is iptc?
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on July 22, 2011, 01:31:46 PM
hello, I do not know what to serve this mod. What is iptc?
http://www.iptc.org/site/Photo_Metadata/Overview/
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 12, 2012, 04:33:45 PM
Hallo Rembrandt,

in einer älteren Version dieses MODs muss man auch noch sein Suchformular im Template anpassen.
Ist dies nicht mehr vorgesehen?

Gruß
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 12, 2012, 05:03:31 PM
Willkommen im Forum!
..in einer älteren Version dieses MODs muss man auch noch sein Suchformular im Template anpassen.
Ist dies nicht mehr vorgesehen?
..
Nein, da die Exif und IPTC Daten in dieser neuen Version alle verlinkt sind.
Wie das aussieht b.z.w. funktioniert kannst du dir hier ansehen: DEMO (http://galerie.fotografie-erleben.eu/details.php?image_id=63&mode=search)

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 12, 2012, 05:21:03 PM
Danke schonmal :-)

In deinem Link gibt es aber auch mehr Felder in der Suche: http://galerie.fotografie-erleben.eu/search.php
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 12, 2012, 05:30:08 PM
achso ja, ist wahrscheinlich noch vom alten mod, die änderung in der search_form kannst du ja vom alten mod übernehmen.
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 12, 2012, 06:11:50 PM
Ok, also bringt es doch noch etwas wenn ich die search_form anpasse?
Wird mir aus deinem ersten und dem letzten Beitrag nicht ganz klar.

Gruß
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 12, 2012, 06:24:47 PM
Ok, also bringt es doch noch etwas wenn ich die search_form anpasse?
...
ist relativ, wenn sich jemand ein Bild mit IPTC od. EXIF ansieht und er möchte weitere Bilder mit sagen wir "F5.6" ansehen braucht er nur auf die verlinkte Blendenzahl klicken und er bekommt alle Bilder mit dieser Blende geliefert.
Wenn er die gewünschte Blende im Suchformular eingibt bekommt er auch die Bilder mit dieser Blendenzahl geliefert, aber natürlich auch jene Bilder die "F5.6"  z.b. in der Beschreibung stehen haben.
kannst du ja machen wie du möchtest b.z.w. wie du es für besser haltest.

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 15, 2012, 04:15:09 PM
Hallo,

ich hoffe du kannst mir nochmal helfen.
Die Bilder die ich hochlade haben IPTC Informationen zB im Feld country.

In der checkimages.php komme ich allerdings nie in den Fall if(isset($info['APP13'])){ in dem Part den man für den MOD einfügen sollte.
Daher ist auch die Query nicht gefüllt und es gibt für das Bild keine IPTV Daten in der DB.

Wenn ich im pload sage, er soll die Beschreibung aus den IPTC Daten übernehmen funktioniert das also.

Kann es sein, dass if(isset($info['APP13'])){ auf die schon auf dem Server verkleinerte Datei zielt, die garkeine IPTC Daten mehr enthält?

Gruß
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 15, 2012, 04:48:33 PM
Hi!
...
In der checkimages.php komme ich allerdings nie in den Fall if(isset($info['APP13'])){ in dem Part den man für den MOD einfügen sollte.
Daher ist auch die Query nicht gefüllt und es gibt für das Bild keine IPTV Daten in der DB.....
keine ahnung was du damit meinst, nur soviel die checkimages.php ist nur für die Bilder zuständig die du per FTP hochgeladen hast und noch nicht in der DB stehen.

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 15, 2012, 06:26:24 PM
In deinem MOD gibt es einen Part den man in die chckimages.php einfügen soll:
//############################### Start IPTC ############################################
$src_file = ($big_file) ? MEDIA_PATH."/".$cat_id."/".$big_folder."/".$big_file : $file;
$size = getimagesize ($src_file, $info);
  if(isset($info['APP13'])){
$iptc_array = get_iptc_info($info['APP13']);
foreach ($iptc_array as $key => $val) {
  $additional_field_sql .= ',image_'.$key;
  $additional_value_sql .= ",'".$val."'";
}
  }
//############################### End IPTC ##############################################

Ich habe Bilder via FTP hochgeladen und möchte nun, dass die checkimages.php diese in die DB übernimmt. Aber halt mit den IPTC Daten zu image_city, image_country usw ... dies geschieht nicht.
$additional_field_sql ist leer, da das Programm nicht in den Fall if(isset($info['APP13'])){ kommt.
Ich hoffe du verstehst, was ich meine.

Danke dir für deine Hilfe.
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 15, 2012, 06:47:01 PM
tja was soll ich dir sagen, ich habe den Mod schon x-mal auf Webseiten eingebaut und er funktioniert.
Mit welchen Programm hast du den die IPTC Daten erstellt?
oder besser noch lasse mir so ein Bild zukommen damit ich mir das Ansehen kann.

EDIT: Bild bekommen, Mod in 3min. eingebaut - Bild hochgeladen - IPTC werden einwandfrei angezeigt: http://test.vienna-pictures.com/details.php?image_id=323

Kann es sein das du den exifmod 1.7.10 auch eingebaut hast?

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 16, 2012, 04:01:39 PM
Also ich habe ein frisches System aufgesetzt und nur deinen MOD installiert.
Jetzt bin ich ratlos. Kannst du mir mal deine checkimages.php System schicken?
Eine andere Datei müsste ja nicht relevant für das hinzufügen der Bilder sein, oder?

Ich bezweifle das ich einen Fehler beim Einbau gemacht habe, aber ausschließen kann ich es nicht.
Bin es 3x durchgegangen.

Gruß
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 16, 2012, 06:47:27 PM
bitte sehr...
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 16, 2012, 07:02:26 PM
So ich habe die Lösung. Dein MOD Funktioniert nur, wenn in $src_file = ($big_file) ? MEDIA_PATH."/".$cat_id."/".$big_folder."/".$big_file : $file; $big_file gesetzt ist.
$big_file ist nur gesetzt, wenn man das oben in den Einstellungen macht: $big_default = 1; //save original image (0 or 1)

Ich weiß nicht, ob das irgendwo stand, ich habs jedenfalls nicht gesehen?

Jedenfalls vielen Dank für deine Hilfe!
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 16, 2012, 07:05:47 PM
du siehst ja das in der checkimages "$big_default " nicht gesetzt ist.
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 17, 2012, 06:22:16 PM
Hallo nochmal,

in den Captions können auch Anführungsstriche stehen. Was bei mir zu Fehlern führt.

foreach ($iptc_array as $key => $val) {
  $additional_field_sql .= ',image_'.$key;
  $additional_value_sql .= ",'".$val."'";
}

Vielleicht lieber so?

foreach ($iptc_array as $key => $val) {
  $additional_field_sql .= ',image_'.$key;
  $additional_value_sql .= ",'".htmlspecialchars($val, ENT_QUOTES)."'";
}

Was meint Ihr?

Gruß
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on January 17, 2012, 07:20:25 PM
Sehr gute idee, ich würde sie "nur" maskieren.
$additional_value_sql .= ",'".addslashes($val)."'";

das könnte dich auch interessieren :)
http://www.4homepages.de/forum/index.php?topic=29950.msg158671#msg158671

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: MaracujaJoe on January 17, 2012, 07:51:11 PM
Danke :-)
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: stu2000 on April 29, 2013, 02:48:11 PM
Hi Rembrandt, wonder if you can help, I have just spent the last 3 days trying to get this modification to work.

I have a plain default install on 1.7.11 and only other mod, is your "Create login Page".

My installation is here: http://www.stonehaven-heritage.org/gallery/index.php

Long story short, No IPTC data is showing up.

All I need to do is create a gallery which will hold 800 images and allow search by IPTC.

I added your modification (even tried 1.7.6 Mod u have listed), install goes fine.

I have 3 test imagees, I logged into the backend of the gallery, created a folder and then added the files via ftp to folder (1).

back in the admin, I run "Check New Images", it finds the 3 images, all boxes are set to YES against IPTC, I then ran "Create IPTC Data"

and get this:
Fulltext Indexing between ID 0 and 3:
Processing image 46, ID 1...... NO IPTC
Processing image 47, ID 2...... NO IPTC
Processing image 586, ID 3...... NO IPTC

IPTC Data Created!.

But on viewing the site, I can't even search for the image name of 586 for example, search does not work at all.

I just needa default install with the ability to add photos with Windows Meta Data and for it to be searchable.

Can you help.

What are your rates for custom installs?

Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on April 29, 2013, 03:30:10 PM
...Long story short, No IPTC data is showing up.
...
what can I say, the mod on your site works very well.
look here (my picture  :evil: ):
http://www.stonehaven-heritage.org/gallery/details.php?image_id=5
your pictures have no iptc data...

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: stu2000 on April 29, 2013, 03:41:31 PM
^^ Adding to above post, I downloaded a sample file from your demo site (which contains IPTC data) and it shows fine.

So why do my 3 images not show IPTC data etc, I have uploaded my 3 test images to a zip file (http://www.gallery.stonehaven-heritage.org/test.zip) 4Mb download.

When I right click the images in Windows 7 and select properties, I can see the Meta Data, but this sis not transferring to the Web gallery.

Image data, created using Adobe Photoshop if that helps.
=============

Is IPTC data the same as XMP Meta Data, if not How do I search for XMP Meta Data, as per my 3 test files.

=============

I wasn't stealing your Image, used purely for test purposes, it will be deleted ASAP. Sorry  :oops:
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on April 29, 2013, 05:39:02 PM
....So why do my 3 images not show IPTC data etc,...
Your Photos contain no IPTC or EXIF Data.

mfg Andi
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: stu2000 on April 29, 2013, 06:13:29 PM
There not my photos, but that of my customers. When I open them up in Adobe Photoshop, I see the following screenshot, with IPTC data loaded. Can you advise, if this is not IPTC data, what is it and can it be searched.


I think I maybe in way too far over my head with this. The attacthed screenshot shows IPTC data, but its not searchable. After speaking to my customer, he says the data is Windows XMP, if this is the case, can this data be searched?

I appreciate your help.

Thank you.
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: AndreasN on May 02, 2013, 09:17:54 AM
Hi,

ich hab in eine nackte 4images Installation das IPTC Addin implementiert. Ich kann auch nach Metadaten suchen, allerdings funktioniert die Suche nach Dateinamen bzw. Bildnamen nicht mehr.
Woran kann das liegen, ist das bei euch auch so?

lg
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: Rembrandt on May 02, 2013, 03:39:03 PM
.. ist das bei euch auch so?
..
ja, ich werde mir das ansehen...

mfg Andi

EDIT: Update Step 5.) , sollte jetzt funktionieren
Title: Re: [Mod] IPTC V1.7.10 Suchfelder erweiterung
Post by: jamie2 on July 21, 2016, 08:55:16 PM
Hi:
 I get the following error:
 
Quote
  DB Error: Bad SQL Query: REPLACE INTO 4images_wordmatch (image_id, word_id, name_match, desc_match, keys_match, caption_match, caption_writer_match, headline_match, special_instructions_match, byline_match, byline_title_match, credit_match, source_match, object_name_match, date_created_match, city_match, state_match, country_match, original_transmission_reference_match, category_match, supplemental_category_match, keyword_match, copyright_notice_match) VALUES (5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Column count doesn't match value count at row 1
Could you please tell me how to fix this?