[Linpha-cvs] SF.net SVN: linpha: [4716] trunk/linpha2
Status: Inactive
Brought to you by:
bzrudi
From: <bz...@us...> - 2007-03-23 13:46:50
|
Revision: 4716 http://svn.sourceforge.net/linpha/?rev=4716&view=rev Author: bzrudi Date: 2007-03-23 06:46:42 -0700 (Fri, 23 Mar 2007) Log Message: ----------- minor cleanups and improvements, to be continued.... Modified Paths: -------------- trunk/linpha2/lib/classes/linpha.exiftool.class.php trunk/linpha2/lib/classes/linpha.metadata.class.php trunk/linpha2/lib/include/metadata_iptc_edit.php trunk/linpha2/lib/include/metadata_xmp_edit.php trunk/linpha2/templates/default/fragments.php Modified: trunk/linpha2/lib/classes/linpha.exiftool.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-03-23 13:45:37 UTC (rev 4715) +++ trunk/linpha2/lib/classes/linpha.exiftool.class.php 2007-03-23 13:46:42 UTC (rev 4716) @@ -310,7 +310,7 @@ 'contributor' => 'Contributor', 'coverage' => 'Coverage', 'creator' => 'Creator', - //'date' => 'Date', + 'date' => 'Date', 'description' => 'Description', 'format' => 'Format', 'identifier' => 'Identifier', @@ -327,7 +327,7 @@ 'colormode' => 'Color Mode', 'country' => 'Country', 'credit' => 'Credit', - 'datecreated' => 'DateCreated', + //'datecreated' => 'DateCreated', 'headline' => 'Headline', 'iccprofilename' => 'ICC Profile Name', 'instructions' => 'Instructions', Modified: trunk/linpha2/lib/classes/linpha.metadata.class.php =================================================================== --- trunk/linpha2/lib/classes/linpha.metadata.class.php 2007-03-23 13:45:37 UTC (rev 4715) +++ trunk/linpha2/lib/classes/linpha.metadata.class.php 2007-03-23 13:46:42 UTC (rev 4716) @@ -444,6 +444,9 @@ $meta_array['linDoBackup'] = false; } + /** + * Apply MetaData to all files in folder + */ if(!isset($meta_array['linRecursiveUpdate'])) { $recursive_update = false; @@ -487,7 +490,8 @@ * Prevent exiftool from backing up file, as we do take * care of it our own :-) */ - $parameter = "-overwrite_original -n "; + $parameter = "-overwrite_original " . // No Backup + "-n "; // Read numbers /** * Update all images in folder with given MetaData, @@ -504,7 +508,7 @@ } /** - * Apply XMP MetaData to IPTC Segment + * Apply XMP MetaData to IPTC Segment? */ if(!isset($meta_array['linXmp2Iptc'])) { @@ -552,23 +556,14 @@ /** * Copy XMP to IPTC if needed - * $parameter tags copied from xmp2iptc.args file from the - * exiftool distribution */ if($xmp2iptc) { - echo "MAKE COPY"; - $options = " -TagsFromFile "; - - if($recursive_update) - { - $options .= "-r " . - "-ext jpeg -ext jpg -ext tif -ext tiff "; - } + $options = "-TagsFromFile "; + $arguments = + LINPHA_DIR.'/lib/classes/exiftool/xmp2iptc.args'; - $arguments = LINPHA_DIR.'/lib/classes/exiftool/xmp2iptc.args'; - - exec("$exiftool $options $file -@ $arguments $file"); + exec("$exiftool $options $file -@ $arguments $file"); } /** Modified: trunk/linpha2/lib/include/metadata_iptc_edit.php =================================================================== --- trunk/linpha2/lib/include/metadata_iptc_edit.php 2007-03-23 13:45:37 UTC (rev 4715) +++ trunk/linpha2/lib/include/metadata_iptc_edit.php 2007-03-23 13:46:42 UTC (rev 4716) @@ -26,24 +26,24 @@ if(!defined('LINPHA_DIR')) { exit(1); } ?> -<tr><td rwospan="2"> - <input type='checkbox' name='linDoBackup' checked> - <?php echo i18n("Backup Original File"); ?> +<tr><td> + <img style="margin-left: 20px;" src="<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$GLOBALS['linpha']->template->idCurrent; + ?>" width="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" height="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" /> </td> -</tr> -<tr><td rwospan="2"> + <td> + <input type='checkbox' name='linDoBackup' checked> + <?php echo i18n("Backup Original File"); ?><br /> + <input type='checkbox' name='linIptc2Xmp' disabled> + <?php echo i18n("Apply MetaData Also To XMP Segment"); ?><br /> <input type='checkbox' name='linRecursiveUpdate'> - <?php echo i18n("Apply To All Images In Album"); ?> + <?php echo i18n("Apply To All Images In Album"); ?><br /> </td> </tr> +<tr><td colspan = "3"><hr /></td></tr> <?php -/* -<tr><td rwospan="2"> - <input type='checkbox' name='linViceVersa' checked> - <?php echo i18n("Apply MetaData Also To XMP Segment"); ?> - </td> -</tr> -*/ + /** * We are going to save all IPTC data UTF8 encoded in database */ @@ -54,19 +54,29 @@ $MetaData->setMetaFields('iptc'); $file_data = $MetaData->objMetaTool->readMetaDataFromFile('iptc', $filename); + /** * User may have selected all fields, so there are no available fields left * create emtpy array to prevent notices... */ $iptc_avail = $MetaData->available_fields['iptc']; -if(!is_array($iptc_avail)){ $iptc_avail = array(); }; +if(!is_array($iptc_avail)) +{ + $iptc_avail = array(); +} + + /** * User may have selected not even a single field for now, so there are no * selected fields, create emtpy array to prevent notices... */ $iptc_defined = $MetaData->defined_fields['iptc']; -if(!is_array($iptc_defined)){ $iptc_defined = array(); }; +if(!is_array($iptc_defined)) +{ + $iptc_defined = array(); +} + /** * Merge both arrays to make all fields avail */ @@ -126,47 +136,30 @@ "</td>" . "</tr>"; break; - - case 'caption-abstract': + + case 'specialinstructions': echo "<tr>" . "<td>$value</td>" . "<td> ". - "<textarea style='width:350px; height:60px;' class='linForms' - name='$name'>$file_iptc</textarea>" . + "<textarea style='width:350px; height:50px;' class='linForms' + name='$name' maxlength='255'>$file_iptc</textarea>" . "</td>" . "</tr>"; break; - case 'urgency': - /** - * Fast easy init ;-) - */ - for($i = 0; $i <= 8; $i++) - { - $sel[$i] = " "; - } - $sel[$file_iptc] = "selected"; - + + case 'caption-abstract': echo "<tr>" . "<td>$value</td>" . "<td> ". - "<select name='$name' style='width:350px; size='1' - class='linForms'>" . - "<option value='0' $sel[0]>0: None</option>" . - "<option value='1' $sel[1]>1: High</option>" . - "<option value='2' $sel[2]>2: </option>" . - "<option value='3' $sel[3]>3: </option>" . - "<option value='4' $sel[4]>4: </option>" . - "<option value='5' $sel[5]>5: Normal</option>" . - "<option value='6' $sel[6]>6: </option>" . - "<option value='7' $sel[7]>7: </option>" . - "<option value='8' $sel[8]>8: Low</option>" . + "<textarea style='width:350px; height:60px;' class='linForms' + name='$name' maxlength='1999'>$file_iptc</textarea>" . "</td>" . "</tr>"; break; - + default: echo "<tr>" . Modified: trunk/linpha2/lib/include/metadata_xmp_edit.php =================================================================== --- trunk/linpha2/lib/include/metadata_xmp_edit.php 2007-03-23 13:45:37 UTC (rev 4715) +++ trunk/linpha2/lib/include/metadata_xmp_edit.php 2007-03-23 13:46:42 UTC (rev 4716) @@ -25,39 +25,53 @@ if(!defined('LINPHA_DIR')) { exit(1); } ?> -<tr><td rwospan="2"> +<tr><td> + <img style="margin-left: 20px;" src="<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$GLOBALS['linpha']->template->idCurrent; + ?>" width="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" height="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; + ?>" /> + </td> + <td> <input type='checkbox' name='linDoBackup' checked> - <?php echo i18n("Backup Original File"); ?> - </td> -</tr> -<tr><td rwospan="2"> + <?php echo i18n("Backup Original File"); ?><br /> <input type='checkbox' name='linXmp2Iptc' checked> - <?php echo i18n("Apply MetaData Also To IPTC Segment"); ?> - </td> -</tr> -<tr><td rwospan="2"> + <?php echo i18n("Apply MetaData Also To IPTC Segment"); ?><br /> <input type='checkbox' name='linRecursiveUpdate'> - <?php echo i18n("Apply To All Images In Album"); ?> + <?php echo i18n("Apply To All Images In Album"); ?><br /> </td> </tr> +<tr><td colspan = "3"><hr /></td></tr> <?php $MetaData = new LinMetaData(); $MetaData->setMetaFields('xmp'); $file_data = $MetaData->objMetaTool->readMetaDataFromFile('xmp', $filename); +/** + * User may have selected all fields, so there are no available fields left + * create emtpy array to prevent notices... + */ $xmp_avail = $MetaData->available_fields['xmp']; -if(!is_array($xmp_avail)){ $xmp_avail = array(); }; +if(!is_array($xmp_avail)) +{ + $xmp_avail = array(); +} +/** + * User may have selected not even a single field for now, so there are no + * selected fields, create emtpy array to prevent notices... + */ $xmp_defined = $MetaData->defined_fields['xmp']; -if(!is_array($xmp_defined)){ $xmp_defined = array(); }; +if(!is_array($xmp_defined)) +{ + $xmp_defined = array(); +} /** - * Merge arrays + * Merge both arrays to make all fields avail */ $xmp_array = $xmp_avail + $xmp_defined; -//var_dump($file_data); /** * Now output the actual HTML form @@ -75,15 +89,54 @@ $file_xmp = ""; } - echo - "<tr>" . - "<td>$value</td>" . - "<td> ". - "<input size=55 class='linForms' name='$name' - type='text' value='".$file_xmp."'>" . - "</td>" . - "</tr>"; - + /** + * We need to take care of some special fields, e.g. special length, + * special types (select field) and so on... + */ + //echo $name."<br>"; + //echo $file_iptc."<br>"; + switch($name) + { + case 'urgency': + /** + * Fast easy init ;-) + */ + for($i = 0; $i <= 8; $i++) + { + $sel[$i] = " "; + } + $sel[$file_xmp] = "selected"; + + echo + "<tr>" . + "<td>$value</td>" . + "<td> ". + "<select name='$name' style='width:350px; size='1' + class='linForms'>" . + "<option value='0' $sel[0]>0: None</option>" . + "<option value='1' $sel[1]>1: High</option>" . + "<option value='2' $sel[2]>2: </option>" . + "<option value='3' $sel[3]>3: </option>" . + "<option value='4' $sel[4]>4: </option>" . + "<option value='5' $sel[5]>5: Normal</option>" . + "<option value='6' $sel[6]>6: </option>" . + "<option value='7' $sel[7]>7: </option>" . + "<option value='8' $sel[8]>8: Low</option>" . + "</td>" . + "</tr>"; + break; + + default: + echo + "<tr>" . + "<td>$value</td>" . + "<td> ". + "<input name='$name' style='width:350px;' class='linForms' + type='text' value='".$file_xmp."'>" . + "</td>" . + "</tr>"; + break; + } } +/* vi: set ts=4 sw=4 sts=4 */ ?> - Modified: trunk/linpha2/templates/default/fragments.php =================================================================== --- trunk/linpha2/templates/default/fragments.php 2007-03-23 13:45:37 UTC (rev 4715) +++ trunk/linpha2/templates/default/fragments.php 2007-03-23 13:46:42 UTC (rev 4716) @@ -201,11 +201,6 @@ </form> </div> - <img style="margin-left: 20px;" src="<?php echo LINPHA_CLIENT.'/get_thumb.php?linId='.$GLOBALS['linpha']->template->idCurrent; - ?>" width="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; - ?>" height="<?php echo $GLOBALS['linpha']->sql->config->value['sys_style_thumb_size_display']; - ?>" /> - <?php if($GLOBALS['linpha']->imgview->img_type!=0) { ?> <div id="linDivMetaIptc"> <?php if($GLOBALS['linpha']->sql->config->value['sys_image_iptc']) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |