[Linpha-cvs] SF.net SVN: linpha: [4410] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <fan...@us...> - 2006-03-12 22:57:14
|
Revision: 4410 Author: fangehrn Date: 2006-03-12 14:57:02 -0800 (Sun, 12 Mar 2006) ViewCVS: http://svn.sourceforge.net/linpha/?rev=4410&view=rev Log Message: ----------- * saving exif/iptc infos on image view Modified Paths: -------------- trunk/linpha2/ChangeLog trunk/linpha2/lib/classes/linpha.imgview.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/linpha2.specs.txt trunk/linpha2/templates/main_html/view_img.html.php Modified: trunk/linpha2/ChangeLog =================================================================== --- trunk/linpha2/ChangeLog 2006-03-12 22:21:55 UTC (rev 4409) +++ trunk/linpha2/ChangeLog 2006-03-12 22:57:02 UTC (rev 4410) @@ -1,3 +1,6 @@ +2006-03-12 flo + * saving exif/iptc infos on image view + 2006-03-08 flo * finished first stage of image fields * adding image and album comments Modified: trunk/linpha2/lib/classes/linpha.imgview.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-12 22:21:55 UTC (rev 4409) +++ trunk/linpha2/lib/classes/linpha.imgview.class.php 2006-03-12 22:57:02 UTC (rev 4410) @@ -51,10 +51,6 @@ { $this->id_parent = 0; - - - - if(isset($_GET['id']) && $_GET['id'] != 0) { if(isset($_GET['view'])) @@ -63,7 +59,7 @@ } /** - * switch between alb_view and img_view + * set file informations */ $current_data = $GLOBALS['linpha']->db->GetRow("SELECT id, name, img_type, parent_id, md5sum FROM ".PREFIX."photos " . "WHERE id = '".linSql::linAddslashes($_GET['id'])."'"); @@ -78,6 +74,9 @@ { $this->id_current = $current_data['id']; + /** + * switch between thumb_view and img_view + */ if( $this->img_type == 0) { $this->id_parent = $current_data['id']; @@ -364,33 +363,77 @@ /** * set image informations */ - $this->output['image_infos'] = ''; include_once(LINPHA_DIR.'/lib/classes/linpha.metadata.class.php'); $MetaData = new MetaData(); $MetaData->setFields('exif'); $MetaData->setFields('iptc'); + + $array_files = $GLOBALS['linpha']->sql->getFullFilenameFromId( $this->id_current ); + $this->full_filename = $this->album_dir.implode('/',$array_files); - $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."meta_fields WHERE builtin = '10' ORDER by id"); - while($data = $query->FetchRow()) - { - $name = $MetaData->getNameOfField( $data['name'], false ); + /** + * read exif and iptc from file + */ + if($GLOBALS['linpha']->sql->config->value['sys_image_exif']) + { + /** + * check if exif information are already in db + * if not, read exif information from file and store it in the db + */ + $query = $GLOBALS['linpha']->db->Execute("SELECT md5sum ". + "FROM ".PREFIX."meta_exif WHERE md5sum = '".$this->md5sum."'"); + $num = $query->RecordCount(); + if($num == 0) + { + include_once(LINPHA_DIR.'/lib/classes/phpmeta/JPEG.php'); // used for jpeg comment + include_once(LINPHA_DIR.'/lib/classes/phpmeta/EXIF.php'); + $MetaData->saveExifData(LINPHA_DIR.'/'.$this->full_filename,$this->md5sum); + } + } + + if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) + { + /** + * check if there is already IPTC info in db if not, get IPTC + * information from file and store it in the db + */ + $query = $GLOBALS['linpha']->db->Execute("SELECT md5sum ". + "FROM ".PREFIX."meta_iptc WHERE md5sum = '".$this->md5sum."'"); + $num = $query->RecordCount(); + if($num == 0) + { + include_once(LINPHA_DIR.'/lib/classes/phpmeta/Photoshop_IRB.php'); + include_once(LINPHA_DIR.'/lib/classes/phpmeta/JPEG.php'); + $MetaData->saveIptcData(LINPHA_DIR.'/'.$this->full_filename,$this->md5sum); + } + } - $pos = strpos($key,'_'); - $first_part = substr($key,0,$pos); - $last_part = substr($key,$pos+1); - switch($first_part) + + /** + * read image information from database + */ + $this->output['image_infos'] = ''; + $query = $GLOBALS['linpha']->db->Execute("SELECT name FROM ".PREFIX."meta_fields WHERE builtin = '10' ORDER by id"); + while($data = $query->FetchRow()) { - case 'id': // builtin and own fields and special fields like filename, imagesize and dimension - break; - case 'exif': - break; - case 'iptc': - break; + $name = $MetaData->getNameOfField( $data['name'], false ); + + $pos = strpos($key,'_'); + $first_part = substr($key,0,$pos); + $last_part = substr($key,$pos+1); + switch($first_part) + { + case 'id': // builtin and own fields and special fields like filename, imagesize and dimension + break; + case 'exif': + break; + case 'iptc': + break; + } + $value = ''; + + $this->output['image_infos'] .= $name.': '.$value.' <br />'; } - $value = ''; - - $this->output['image_infos'] .= $name.': '.$value.' <br />'; - } } Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-03-12 22:21:55 UTC (rev 4409) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2006-03-12 22:57:02 UTC (rev 4410) @@ -221,7 +221,7 @@ $str_values = "'".$md5sum."', "; foreach($exif_tags AS $key=>$value) { - if($value != "") + if($value != "" && in_array($key,$this->defined_exif_fields)) { /** * there are currently only entries at level deep 2 and 5 in the @@ -236,7 +236,7 @@ $str_columns .= strtolower($key).', '; $exif_value = $exif_data[ $array_pieces[0] ][ $array_pieces[1] ]['Text Value']; - $str_values .= "'".linpha_addslashes(trim( $exif_value ))."', "; + $str_values .= "'".linSql::linAddslashes(trim( $exif_value ))."', "; } break; case 5: @@ -245,7 +245,7 @@ $str_columns .= strtolower($key).', '; $exif_value = $exif_data[ $array_pieces[0] ][ $array_pieces[1] ][ $array_pieces[2] ][ $array_pieces[3] ][ $array_pieces[4] ]['Text Value']; - $str_values .= "'".linpha_addslashes(trim( $exif_value ))."', "; + $str_values .= "'".linSql::linAddslashes(trim( $exif_value ))."', "; } break; default: @@ -255,17 +255,18 @@ } } - include_once(LINPHA_DIR.'/include/phpmeta/JPEG.php'); - /** * add jpegcomment */ - $jpeg_header_data = get_jpeg_header_data( $filename ); - $comment = get_jpeg_Comment( $jpeg_header_data ); - if(!empty($comment)) + if(in_array('jpegcomment',$this->defined_exif_fields)) { - $str_columns .= 'jpegcomment, '; - $str_values .= "'".linpha_addslashes(trim( $comment ))."', "; + $jpeg_header_data = get_jpeg_header_data( $filename ); + $comment = get_jpeg_Comment( $jpeg_header_data ); + if(!empty($comment)) + { + $str_columns .= 'jpegcomment, '; + $str_values .= "'".linSql::linAddslashes(trim( $comment ))."', "; + } } /** @@ -278,12 +279,12 @@ /** * no double entries */ - $query = $GLOBALS['db']->Execute("SELECT md5sum FROM ".PREFIX."meta_exif ". + $query = $GLOBALS['linpha']->db->Execute("SELECT md5sum FROM ".PREFIX."meta_exif ". "WHERE md5sum = '".$md5sum."'"); $num = $query->RecordCount(); if($num == 0) { - $GLOBALS['db']->Execute("INSERT into ".PREFIX."meta_exif (".$str_columns.") ". + $GLOBALS['linpha']->db->Execute("INSERT into ".PREFIX."meta_exif (".$str_columns.") ". "VALUES (".$str_values.")"); } } @@ -355,167 +356,170 @@ $caption_writer = ""; $IPTC_Meta = array(); - $query = $GLOBALS['db']->Execute("SELECT md5sum FROM ".PREFIX."meta_iptc " . + $query = $GLOBALS['linpha']->db->Execute("SELECT md5sum FROM ".PREFIX."meta_iptc " . "WHERE md5sum = '".$md5sum."' "); $num = $query->RecordCount(); if($num == 0) { - if(is_array($IPTC_Info)) - { - // Cycle through each of the IPTC-NAA IIM records - foreach($IPTC_Info as $IPTC_Record) - { - switch ( $IPTC_Record['IPTC_Type'] ) - { - case "2:05": // object name - $object_name = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:07": // edit_status - $edit_status = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:10": // priority - $priority = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:15": // category - $category = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:20": // supplemental_categorie - $supplemental_categorie .= " ".linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:22": // job_id - $job_id = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:25": // keywords - $keywords .= " ".linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:30": // date_released - $date_released = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:35": // time_released - $time_released = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:40": // instructions - $instructions = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:55": // date_created - $date_created = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:60": // time_created - $time_created = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:65": // program - $program = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:75": // object_cycle - $object_cycle = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:80": // byline - $byline = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:85": // byline_title - $byline_title = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:90": // city - $city = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:92": // sublocation - $sublocation = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:95": // state - $state = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:100": // country_code - $country_code = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:101": // country - $country = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:103": // trans_reference - $trans_reference = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:105": // headline - $headline = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:110": // credit - $credit = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:115": // source - $source = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:116": // copyright - $copyright = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:120": // caption - $caption = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - - case "2:122": // caption_writer - $caption_writer = linpha_addslashes(rtrim($IPTC_Record['RecData'])); - break; - } - } - - $saveiptc = $GLOBALS['db']->Execute("INSERT INTO ".PREFIX."meta_iptc ( " . - "md5sum, caption, caption_writer, headline, " . - "instructions, keywords, category, supplemental_categorie, " . - "copyright, byline, byline_title, credit, source, " . - "edit_status, priority, object_cycle, job_id, program, " . - "object_name, date_created, date_released, time_created, " . - "time_released, city, sublocation, state, country, " . - "country_code, trans_reference, marked_ignored) " . - "VALUES('".$md5sum."', '".$caption."', '".$caption_writer."', '".$headline."', " . - "'".$instructions."', '".$keywords."', '".$category."', '".$supplemental_categorie."', " . - "'".$copyright."', '".$byline."', '".$byline_title."', '".$credit."', '".$source."', " . - "'".$edit_status."', '".$priority."', '".$object_cycle."', '".$job_id."', '".$program."', " . - "'".$object_name."', '".$date_created."', '".$date_released."', '".$time_created."', " . - "'".$time_released."', '".$city."', '".$sublocation."', '".$state."', '".$country."', " . - "'".$country_code."', '".$trans_reference."', '0')"); - - return true; + if(is_array($IPTC_Info)) + { + // Cycle through each of the IPTC-NAA IIM records + foreach($IPTC_Info as $IPTC_Record) + { + switch ( $IPTC_Record['IPTC_Type'] ) + { + case "2:05": // object name + $object_name = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:07": // edit_status + $edit_status = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:10": // priority + $priority = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:15": // category + $category = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:20": // supplemental_categorie + $supplemental_categorie .= " ".linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:22": // job_id + $job_id = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:25": // keywords + $keywords .= " ".linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:30": // date_released + $date_released = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:35": // time_released + $time_released = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:40": // instructions + $instructions = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:55": // date_created + $date_created = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:60": // time_created + $time_created = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:65": // program + $program = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:75": // object_cycle + $object_cycle = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:80": // byline + $byline = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:85": // byline_title + $byline_title = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:90": // city + $city = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:92": // sublocation + $sublocation = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:95": // state + $state = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:100": // country_code + $country_code = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:101": // country + $country = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:103": // trans_reference + $trans_reference = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:105": // headline + $headline = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:110": // credit + $credit = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:115": // source + $source = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:116": // copyright + $copyright = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:120": // caption + $caption = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + + case "2:122": // caption_writer + $caption_writer = linSql::linAddslashes(rtrim($IPTC_Record['RecData'])); + break; + } + } + + $GLOBALS['linpha']->db->Execute("INSERT INTO ".PREFIX."meta_iptc ( " . + "md5sum, caption, caption_writer, headline, " . + "instructions, keywords, category, supplemental_categorie, " . + "copyright, byline, byline_title, credit, source, " . + "edit_status, priority, object_cycle, job_id, program, " . + "object_name, date_created, date_released, time_created, " . + "time_released, city, sublocation, state, country, " . + "country_code, trans_reference, marked_ignored) " . + "VALUES('".$md5sum."', '".$caption."', '".$caption_writer."', '".$headline."', " . + "'".$instructions."', '".$keywords."', '".$category."', '".$supplemental_categorie."', " . + "'".$copyright."', '".$byline."', '".$byline_title."', '".$credit."', '".$source."', " . + "'".$edit_status."', '".$priority."', '".$object_cycle."', '".$job_id."', '".$program."', " . + "'".$object_name."', '".$date_created."', '".$date_released."', '".$time_created."', " . + "'".$time_released."', '".$city."', '".$sublocation."', '".$state."', '".$country."', " . + "'".$country_code."', '".$trans_reference."', '0')"); + + return true; + } + else + { + /** + * save empty entry to prevent re-read on every page visit + */ + $GLOBALS['linpha']->db->Execute("INSERT INTO ".PREFIX."meta_iptc ( " . + "md5sum, caption, caption_writer, headline, " . + "instructions, keywords, category, supplemental_categorie, " . + "copyright, byline, byline_title, credit, source, " . + "edit_status, priority, object_cycle, job_id, program, " . + "object_name, date_created, date_released, time_created, " . + "time_released, city, sublocation, state, country, " . + "country_code, trans_reference, marked_ignored) " . + "VALUES('".$md5sum."', '', '', '', '', '', '', '', '', '', '', '', '', " . + "'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1')"); + + return false; + } } - else - { - $saveiptc_dummy = $GLOBALS['db']->Execute("INSERT INTO ".PREFIX."meta_iptc ( " . - "md5sum, caption, caption_writer, headline, " . - "instructions, keywords, category, supplemental_categorie, " . - "copyright, byline, byline_title, credit, source, " . - "edit_status, priority, object_cycle, job_id, program, " . - "object_name, date_created, date_released, time_created, " . - "time_released, city, sublocation, state, country, " . - "country_code, trans_reference, marked_ignored) " . - "VALUES('".$md5sum."', '', '', '', '', '', '', '', '', '', '', '', '', " . - "'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '1')"); - - return false; - } - } } else { @@ -527,7 +531,7 @@ * generate "more EXIF details" link. Used if we have only IPTC data but * also wonna have an option to display EXIF */ - function showMoreDetailLink($meta) + /*function showMoreDetailLink($meta) { global $exif_less, $exif_more; @@ -545,13 +549,12 @@ "<u><b>".$exif_more." (IPTC)</b></u></a></td></tr>"; } - - } + }*/ /** * prepare EXIF HTML output left menu (get from DB) */ - function showExifData($md5sum) + /*function showExifData($md5sum) { global $exif_less, $exif_more, $str_search_all_images_taken; $link = "<a class='leftmenu' href='".$GLOBALS['img_view']->link_address."&imgid=".$_GET['imgid']."&exif="; @@ -565,7 +568,7 @@ /** * set exif setting in $_SESSION - */ + $show_exif = true; if(isset($_GET['exif']) && !isset($_GET['iptc'])) @@ -594,7 +597,7 @@ { /** * get showed tags according to exif verbosity level - */ + $exif_tags = getExifTagsByVerbosityLevel($exif_level); $str_exif_tags = strtolower( implode(', ',$exif_tags) ); $str_exif_tags .= ", imagedescription, jpegcomment"; @@ -609,7 +612,7 @@ * * use @ because on mysql 3.x we got an undefined index if they * are empty... strange... - */ + $this->exif_imagedescription = @$data['imagedescription']; $this->exif_jpegcomment = @$data['jpegcomment']; @@ -622,7 +625,7 @@ /** * special tags - */ + if($exif_key == 'DateTime' OR $exif_key == 'DateTimeOriginal') { $exif_key = 'DateTime'; @@ -663,12 +666,12 @@ { $this->showMoreDetailLink("exif"); } - } + }*/ /** * prepare IPTC HTML output left menu (get from DB) */ - function showIptcData($md5sum) + /*function showIptcData($md5sum) { global $exif_less, $exif_more, $str_search_all_images_taken; $link = "<a class='leftmenu' href='".$GLOBALS['img_view']->link_address."&imgid=".$_GET['imgid']."&iptc="; @@ -682,7 +685,7 @@ /** * set iptc setting in $_SESSION - */ + $show_iptc = true; if(!isset($_GET['exif'])) @@ -714,7 +717,7 @@ /** * @uses metadata.config.php - */ + $trans_array = translateIptcSearchTags("", "array"); $has_iptc_data = false; @@ -722,7 +725,7 @@ { /** * get showed tags according to iptc verbosity level - */ + $iptc_tags = getIptcTagsByVerbosityLevel($iptc_level); $trans_array=array_flip($trans_array); $iptc_tags = array_intersect($trans_array, $iptc_tags); @@ -785,7 +788,7 @@ { $this->showMoreDetailLink("iptc"); } - } + }*/ /** * edit IPTC Data in HTML popup @@ -805,235 +808,235 @@ - /** - * get array with exiftags and path where they are - * keys are used to create the database table - * - * warning: if making changes in the keys of the array, we will need to - * update the db!! - */ - function getExifTranslationArray() - { - return Array( - // TIFF Rev. 6.0 Attribute Information - // A. Tags relating to image data structure - 'ImageWidth' => '', - 'ImageLength' => '', - 'BitsPerSample' => '', - 'Compression' => '', - 'PhotometricInterpretation' => '', - 'Orientation' => '0/274', - 'SamplesPerPixel' => '', - 'PlanarConfiguration' => '', - 'YCbCrSubSampling' => '', - 'YCbCrPositioning' => '0/531', - 'XResolution' => '0/282', - 'YResolution' => '0/283', - 'ResolutionUnit' => '0/296', - - // B. Tags relating to recording offset - 'StripOffsets' => '', - 'RowsPerStrip' => '', - 'StripByteCounts' => '', - 'JPEGInterchangeFormat' => '', - 'JPEGInterchangeFormatLength' => '', - - // C. Tags relating to image data characteristics - 'TransferFunction' => '', - 'WhitePoint' => '', - 'PrimaryChromaticities' => '', - 'YCbCrCoefficients' => '', - 'ReferenceBlackWhite' => '', - - // D. Other tags - 'DateTime' => '0/306', - 'ImageDescription' => '0/270', - 'Make' => '0/271', - 'Model' => '0/272', - 'Software' => '0/305', - 'Artist' => '0/315', - 'Copyright' => '0/33432', - - // Exif IFD Attribute Information - // A. Tags Relating to Version - 'ExifVersion' => '0/34665/Data/0/36864', - 'FlashpixVersion' => '0/34665/Data/0/40960', - - // B. Tag Relating to Image Data Characteristics - 'ColorSpace' => '0/34665/Data/0/40961', - - // C. Tags Relating to Image Configuration - 'ComponentsConfiguration' => '0/34665/Data/0/37121', - 'CompressedBitsPerPixel' => '0/34665/Data/0/37122', - 'PixelXDimension' => '0/34665/Data/0/40962', - 'PixelYDimension' => '0/34665/Data/0/40963', - - // D. Tags Relating to User Information - //'MakerNote' => '', too big to store!! - 'UserComment' => '0/34665/Data/0/37510', - - // E. Tag Relating to Related File Information - 'RelatedSoundFile' => '', - - // F. Tags Relating to Date and Time - 'DateTimeOriginal' => '0/34665/Data/0/36867', - 'DateTimeDigitized' => '0/34665/Data/0/36868', - 'SubSecTime' => '', - 'SubSecTimeOriginal' => '', - 'SubSecTimeDigitized' => '', - - // G. Tags Relating to Picture-Taking Conditions - 'ExposureTime' => '0/34665/Data/0/33434', - 'FNumber' => '0/34665/Data/0/33437', - 'ExposureProgram' => '0/34665/Data/0/34850', - 'SpectralSensitivity' => '', - 'ISOSpeedRatings' => '0/34665/Data/0/34855', - 'OECF' => '', - 'ShutterSpeedValue' => '0/34665/Data/0/37377', - 'ApertureValue' => '0/34665/Data/0/37378', - 'BrightnessValue' => '0/34665/Data/0/37379', - 'ExposureBiasValue' => '0/34665/Data/0/37380', - 'MaxApertureValue' => '0/34665/Data/0/37381', - 'SubjectDistance' => '0/34665/Data/0/37382', - 'MeteringMode' => '0/34665/Data/0/37383', - 'LightSource' => '0/34665/Data/0/37384', - 'Flash' => '0/34665/Data/0/37385', - 'FocalLength' => '0/34665/Data/0/37386', - 'SubjectArea' => '', - 'FlashEnergy' => '', - 'SpatialFrequencyResponse' => '', - 'FocalPlaneXResolution' => '0/34665/Data/0/41486', - 'FocalPlaneYResolution' => '0/34665/Data/0/41487', - 'FocalPlaneResolutionUnit' => '0/34665/Data/0/41488', - 'SubjectLocation' => '', - 'ExposureIndex' => '', - 'SensingMethod' => '0/34665/Data/0/41495', - 'FileSource' => '0/34665/Data/0/41728', - 'SceneType' => '0/34665/Data/0/41729', - 'CFAPattern' => '', - 'CustomRendered' => '0/34665/Data/0/41985', - 'ExposureMode' => '0/34665/Data/0/41986', - 'WhiteBalance' => '0/34665/Data/0/41987', - 'DigitalZoomRatio' => '0/34665/Data/0/41988', - 'FocalLengthIn35mmFilm' => '', - 'SceneCaptureType' => '0/34665/Data/0/41990', - 'GainControl' => '0/34665/Data/0/41991', - 'Contrast' => '0/34665/Data/0/41992', - 'Saturation' => '0/34665/Data/0/41993', - 'Sharpness' => '0/34665/Data/0/41994', - 'DeviceSettingDescription' => '', - 'SubjectDistanceRange' => '', - - // H. Other Tags - 'ImageUniqueID' => '', - - // GPS Attribute Information - // A. Tags Relating to GPS - 'GPSVersionID' => '0/34853/Data/0/0', - 'GPSLatitudeRef' => '0/34853/Data/0/1', - 'GPSLatitude' => '0/34853/Data/0/2', - 'GPSLongitudeRef' => '0/34853/Data/0/3', - 'GPSLongitude' => '0/34853/Data/0/4', - 'GPSAltitudeRef' => '0/34853/Data/0/5', - 'GPSAltitude' => '0/34853/Data/0/6', - 'GPSTimeStamp' => '0/34853/Data/0/7', - 'GPSSatellites' => '0/34853/Data/0/8', - 'GPSStatus' => '0/34853/Data/0/9', - 'GPSMeasureMode' => '0/34853/Data/0/10', - 'GPSDOP' => '0/34853/Data/0/11', - 'GPSSpeedRef' => '0/34853/Data/0/12', - 'GPSSpeed' => '0/34853/Data/0/13', - 'GPSTrackRef' => '0/34853/Data/0/14', - 'GPSTrack' => '0/34853/Data/0/15', - 'GPSImgDirectionRef' => '0/34853/Data/0/16', - 'GPSImgDirection' => '0/34853/Data/0/17', - 'GPSMapDatum' => '0/34853/Data/0/18', - 'GPSDestLatitudeRef' => '0/34853/Data/0/19', - 'GPSDestLatitude' => '0/34853/Data/0/20', - 'GPSDestLongitudeRef' => '0/34853/Data/0/21', - 'GPSDestLongitude' => '0/34853/Data/0/22', - 'GPSDestBearingRef' => '0/34853/Data/0/23', - 'GPSDestBearing' => '0/34853/Data/0/24', - 'GPSDestDistanceRef' => '0/34853/Data/0/25', - 'GPSDestDistance' => '0/34853/Data/0/26', - 'GPSProcessingMethod' => '0/34853/Data/0/27', - 'GPSAreaInformation' => '0/34853/Data/0/28', - 'GPSDateStamp' => '0/34853/Data/0/29', - 'GPSDifferential' => '0/34853/Data/0/30', - - // Custom Makernotes http://www.ozhiker.com/electronics/pjmt/jpeg_info/makernotes.html - // there are several tags: camera settings etc. might be usefull +/** + * get array with exiftags and path where they are + * keys are used to create the database table + * + * warning: if making changes in the keys of the array, we will need to + * update the db!! + */ +function getExifTranslationArray() +{ + return Array( + // TIFF Rev. 6.0 Attribute Information + // A. Tags relating to image data structure + 'ImageWidth' => '', + 'ImageLength' => '', + 'BitsPerSample' => '', + 'Compression' => '', + 'PhotometricInterpretation' => '', + 'Orientation' => '0/274', + 'SamplesPerPixel' => '', + 'PlanarConfiguration' => '', + 'YCbCrSubSampling' => '', + 'YCbCrPositioning' => '0/531', + 'XResolution' => '0/282', + 'YResolution' => '0/283', + 'ResolutionUnit' => '0/296', + + // B. Tags relating to recording offset + 'StripOffsets' => '', + 'RowsPerStrip' => '', + 'StripByteCounts' => '', + 'JPEGInterchangeFormat' => '', + 'JPEGInterchangeFormatLength' => '', + + // C. Tags relating to image data characteristics + 'TransferFunction' => '', + 'WhitePoint' => '', + 'PrimaryChromaticities' => '', + 'YCbCrCoefficients' => '', + 'ReferenceBlackWhite' => '', + + // D. Other tags + 'DateTime' => '0/306', + 'ImageDescription' => '0/270', + 'Make' => '0/271', + 'Model' => '0/272', + 'Software' => '0/305', + 'Artist' => '0/315', + 'Copyright' => '0/33432', + + // Exif IFD Attribute Information + // A. Tags Relating to Version + 'ExifVersion' => '0/34665/Data/0/36864', + 'FlashpixVersion' => '0/34665/Data/0/40960', + + // B. Tag Relating to Image Data Characteristics + 'ColorSpace' => '0/34665/Data/0/40961', + + // C. Tags Relating to Image Configuration + 'ComponentsConfiguration' => '0/34665/Data/0/37121', + 'CompressedBitsPerPixel' => '0/34665/Data/0/37122', + 'PixelXDimension' => '0/34665/Data/0/40962', + 'PixelYDimension' => '0/34665/Data/0/40963', + + // D. Tags Relating to User Information + //'MakerNote' => '', too big to store!! + 'UserComment' => '0/34665/Data/0/37510', + + // E. Tag Relating to Related File Information + 'RelatedSoundFile' => '', + + // F. Tags Relating to Date and Time + 'DateTimeOriginal' => '0/34665/Data/0/36867', + 'DateTimeDigitized' => '0/34665/Data/0/36868', + 'SubSecTime' => '', + 'SubSecTimeOriginal' => '', + 'SubSecTimeDigitized' => '', + + // G. Tags Relating to Picture-Taking Conditions + 'ExposureTime' => '0/34665/Data/0/33434', + 'FNumber' => '0/34665/Data/0/33437', + 'ExposureProgram' => '0/34665/Data/0/34850', + 'SpectralSensitivity' => '', + 'ISOSpeedRatings' => '0/34665/Data/0/34855', + 'OECF' => '', + 'ShutterSpeedValue' => '0/34665/Data/0/37377', + 'ApertureValue' => '0/34665/Data/0/37378', + 'BrightnessValue' => '0/34665/Data/0/37379', + 'ExposureBiasValue' => '0/34665/Data/0/37380', + 'MaxApertureValue' => '0/34665/Data/0/37381', + 'SubjectDistance' => '0/34665/Data/0/37382', + 'MeteringMode' => '0/34665/Data/0/37383', + 'LightSource' => '0/34665/Data/0/37384', + 'Flash' => '0/34665/Data/0/37385', + 'FocalLength' => '0/34665/Data/0/37386', + 'SubjectArea' => '', + 'FlashEnergy' => '', + 'SpatialFrequencyResponse' => '', + 'FocalPlaneXResolution' => '0/34665/Data/0/41486', + 'FocalPlaneYResolution' => '0/34665/Data/0/41487', + 'FocalPlaneResolutionUnit' => '0/34665/Data/0/41488', + 'SubjectLocation' => '', + 'ExposureIndex' => '', + 'SensingMethod' => '0/34665/Data/0/41495', + 'FileSource' => '0/34665/Data/0/41728', + 'SceneType' => '0/34665/Data/0/41729', + 'CFAPattern' => '', + 'CustomRendered' => '0/34665/Data/0/41985', + 'ExposureMode' => '0/34665/Data/0/41986', + 'WhiteBalance' => '0/34665/Data/0/41987', + 'DigitalZoomRatio' => '0/34665/Data/0/41988', + 'FocalLengthIn35mmFilm' => '', + 'SceneCaptureType' => '0/34665/Data/0/41990', + 'GainControl' => '0/34665/Data/0/41991', + 'Contrast' => '0/34665/Data/0/41992', + 'Saturation' => '0/34665/Data/0/41993', + 'Sharpness' => '0/34665/Data/0/41994', + 'DeviceSettingDescription' => '', + 'SubjectDistanceRange' => '', + + // H. Other Tags + 'ImageUniqueID' => '', + + // GPS Attribute Information + // A. Tags Relating to GPS + 'GPSVersionID' => '0/34853/Data/0/0', + 'GPSLatitudeRef' => '0/34853/Data/0/1', + 'GPSLatitude' => '0/34853/Data/0/2', + 'GPSLongitudeRef' => '0/34853/Data/0/3', + 'GPSLongitude' => '0/34853/Data/0/4', + 'GPSAltitudeRef' => '0/34853/Data/0/5', + 'GPSAltitude' => '0/34853/Data/0/6', + 'GPSTimeStamp' => '0/34853/Data/0/7', + 'GPSSatellites' => '0/34853/Data/0/8', + 'GPSStatus' => '0/34853/Data/0/9', + 'GPSMeasureMode' => '0/34853/Data/0/10', + 'GPSDOP' => '0/34853/Data/0/11', + 'GPSSpeedRef' => '0/34853/Data/0/12', + 'GPSSpeed' => '0/34853/Data/0/13', + 'GPSTrackRef' => '0/34853/Data/0/14', + 'GPSTrack' => '0/34853/Data/0/15', + 'GPSImgDirectionRef' => '0/34853/Data/0/16', + 'GPSImgDirection' => '0/34853/Data/0/17', + 'GPSMapDatum' => '0/34853/Data/0/18', + 'GPSDestLatitudeRef' => '0/34853/Data/0/19', + 'GPSDestLatitude' => '0/34853/Data/0/20', + 'GPSDestLongitudeRef' => '0/34853/Data/0/21', + 'GPSDestLongitude' => '0/34853/Data/0/22', + 'GPSDestBearingRef' => '0/34853/Data/0/23', + 'GPSDestBearing' => '0/34853/Data/0/24', + 'GPSDestDistanceRef' => '0/34853/Data/0/25', + 'GPSDestDistance' => '0/34853/Data/0/26', + 'GPSProcessingMethod' => '0/34853/Data/0/27', + 'GPSAreaInformation' => '0/34853/Data/0/28', + 'GPSDateStamp' => '0/34853/Data/0/29', + 'GPSDifferential' => '0/34853/Data/0/30', + + // Custom Makernotes http://www.ozhiker.com/electronics/pjmt/jpeg_info/makernotes.html + // there are several tags: camera settings etc. might be usefull - // Canon - // overwrite Artist => 0/315 - //'OwnerName' => 'Makernote_Tag/Decoded Data/0/9' - - // Casio - - // Fujifilm - - // Konica/Minolta - - // Nikon + // Canon + // overwrite Artist => 0/315 + //'OwnerName' => 'Makernote_Tag/Decoded Data/0/9' + + // Casio + + // Fujifilm + + // Konica/Minolta + + // Nikon - // Olympus - - // Panasonic - - // Ricoh + // Olympus + + // Panasonic + + // Ricoh - 'JpegComment' => '' - ); - } + 'JpegComment' => '' + ); +} - function createExifTable($array='') +function createExifTable($array='') +{ + if(empty($array)) { - if(empty($array)) + $array = $this->getDefaultExifFields(); + } + + if(DB_TYPE == "mysql") + { + $str = "CREATE TABLE ".PREFIX."meta_exif (". + "md5sum VARCHAR(32) NOT NULL, "; + foreach($array AS $key=>$value) { - $array = $this->getDefaultExifFields(); + $str .= linSql::linAddslashes(strtolower($value))." VARCHAR(255), "; } - - if(DB_TYPE == "mysql") + $str .= "PRIMARY KEY (md5sum), "; + $str .= "KEY (md5sum) )"; + } + elseif(DB_TYPE == "sqlite") + { + $str = "CREATE TABLE ".PREFIX."meta_exif (". + "md5sum VARCHAR(32) PRIMARY KEY NOT NULL, "; + foreach($array AS $key=>$value) { - $str = "CREATE TABLE ".PREFIX."meta_exif (". - "md5sum VARCHAR(32) NOT NULL, "; - foreach($array AS $key=>$value) - { - $str .= linSql::linAddslashes(strtolower($value))." VARCHAR(255), "; - } - $str .= "PRIMARY KEY (md5sum), "; - $str .= "KEY (md5sum) )"; + $str .= strtolower($value)." VARCHAR(255), "; } - elseif(DB_TYPE == "sqlite") + /** + * remove last 2 signs (the comma and the space) + */ + $str = substr($str,0,strlen($str)-2).")"; + } + elseif(DB_TYPE == "postgres") + { + $str = "CREATE TABLE ".PREFIX."meta_exif (". + "md5sum VARCHAR(32) NOT NULL, "; + + foreach($array AS $key=>$value) { - $str = "CREATE TABLE ".PREFIX."meta_exif (". - "md5sum VARCHAR(32) PRIMARY KEY NOT NULL, "; - foreach($array AS $key=>$value) - { - $str .= strtolower($value)." VARCHAR(255), "; - } - /** - * remove last 2 signs (the comma and the space) - */ - $str = substr($str,0,strlen($str)-2).")"; + $str .= strtolower($value)." VARCHAR(255), "; } - elseif(DB_TYPE == "postgres") - { - $str = "CREATE TABLE ".PREFIX."meta_exif (". - "md5sum VARCHAR(32) NOT NULL, "; - - foreach($array AS $key=>$value) - { - $str .= strtolower($value)." VARCHAR(255), "; - } - - /** - * remove last 2 signs (the comma and the space) - */ - $str = substr($str,0,strlen($str)-2).")"; - } - return $str; + + /** + * remove last 2 signs (the comma and the space) + */ + $str = substr($str,0,strlen($str)-2).")"; } + return $str; +} /** * get array with iptctags Modified: trunk/linpha2/linpha2.specs.txt =================================================================== --- trunk/linpha2/linpha2.specs.txt 2006-03-12 22:21:55 UTC (rev 4409) +++ trunk/linpha2/linpha2.specs.txt 2006-03-12 22:57:02 UTC (rev 4410) @@ -51,6 +51,7 @@ - rawurlencode() - htmlspecialchars() - htmlentities() + - smart_htmlspecialchars() from phpmeta used several times in forms in linpha1 ? - ? - users have to use firefox Modified: trunk/linpha2/templates/main_html/view_img.html.php =================================================================== --- trunk/linpha2/templates/main_html/view_img.html.php 2006-03-12 22:21:55 UTC (rev 4409) +++ trunk/linpha2/templates/main_html/view_img.html.php 2006-03-12 22:57:02 UTC (rev 4410) @@ -43,6 +43,8 @@ .add_comment { color: #036; width: 600px; + text-align: left; + margin-left: 100px; } .add_comment input, .add_comment textarea { background-color: #d5eeff; @@ -57,12 +59,13 @@ </style> <div class="add_comment"> <form action="<?php echo $GLOBALS['linpha']->imgview->link_url.'&id='.$GLOBALS['linpha']->imgview->id_current; ?>" method="POST"> -Name: -<input type="text" name="author" value="" size="10" maxlength="40" /> -Comment: -<input type="text" id="comment_text" name="comment_text" value="" size="40" maxlength="40" /> +Add Comment:<br /> +<div id="comment_div_text"> +<input type="text" id="comment_input_text" name="comment_text" value="" size="40" maxlength="40" /> <a href="javascript:open_textarea()">(+)</a> +</div> <textarea style="display: none;" id="comment_textarea" name="comment_textarea" rows="10" cols="50"></textarea> +Name: <input type="text" name="author" value="" size="10" maxlength="40" /> <input type="hidden" name="cmd" value="add_comment" /> <input type="submit" name="submit" value="submit" /> </form> @@ -87,8 +90,8 @@ function open_textarea() { document.getElementById('comment_textarea').style.display = 'block'; - document.getElementById('comment_text').style.display = 'none'; + document.getElementById('comment_div_text').style.display = 'none'; - document.getElementById('comment_textarea').value = document.getElementById('comment_text').value; + document.getElementById('comment_textarea').value = document.getElementById('comment_input_text').value; } </script> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |