coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: ccphoto on May 25, 2008, 05:17:39 PM

Title: IPTC support
Post by: ccphoto on May 25, 2008, 05:17:39 PM
I have just updated to the latest version of Coppermine.

In the previous version I was using (I am not sure of the version number) I had the following modification

Locate the following line of code in include/picmgmt.inc.php
Code: 
$imagesize = getimagesize($image);
Replace it with the following:
Code:
   $imagesize = getimagesize($image,&$info);
   $iptc = iptcparse($info["APP13"]);
   if (is_array($iptc)) {
      $caption.=$iptc['2#120'][0];
      $title.=$iptc['2#005'][0];
      (is_array($iptc['2#025'])) && ($keywords.=implode(" ", $iptc['2#025']));
   }

When batch uploading this mod extracted the file name and placed it in the coppermine Title field
It took the IPTC caption/description and placed it in the coppermine description field.

I have tried the same mod with the new version but uploads fail.

Does anyone know what modification will create the same result with cpg1418
Title: Re: IPTC support
Post by: ccphoto on May 26, 2008, 02:26:13 PM
Ok, I have made progress on this.
Caption now fixed - a radio button in the config section.

I would still like to be able to have the Filename appear automatically in the CPG Title field.

I now know it is possible using the Admin tools to update filename - File title for a gallery but this is not ideal (another step in an already demanding workflow).
Besides I am sure it is possible as I had this feature through the aforementioned mod.

I have made progress.
The following addition to iptc.inc.php

  $IPTC_data=array(        "Title"                        =>    substr ($filename ,0,- 4),     //$iptc["2#005"][0],

(I added "substr ($filename ,0,- 4),     //")
almost does what I want but instead of just the filename it loads the entire path for the file
eg coppermine/albums/myfolder/abcde becomes the title

instead of just abcde

If someone who understands php could help me Id be very grateful.
Thanks