Import IPTC data to corresponding cpg categories Import IPTC data to corresponding cpg categories
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Import IPTC data to corresponding cpg categories

Started by spiros71, December 25, 2007, 02:28:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

spiros71

I have images with IPTC fields and I want them to be imported as coppermine fields. For example:

IPTC keywords: import to coppermine keywords
IPTC object name: import to coppermine image title
IPTC caption: import to coppermine image description

I tried it but it did not import anything.

http://www.translatum.gr/gallery/index.php

spiros71

I tried again with enabled IPTC and it imported them but did not import the Greek letters:

i.e. IPTC keywords in pic were:
Βάρκες - Boats, Αφαιρετική - Abstract, Θάλασσα - Sea

And it imported
- Abstract, Θάλασσα - Sea

Joachim Müller


spiros71

Does this mean that if my coppermine encoding was Windows-1253 for example, Greek would be displayed correctly?

I also have a txt export of the images with the metadata in ASCII format. Would this help in importing them?

lamama

Maybe you can modify CPG to read 'your' IPTC-tags... I've done something similar (?) for german umlauts (üäö etc.).

Take picmgmt.inc.php, search for function add_picture.

search for:
           if (is_array($iptc) && !$title && !$caption && !$keywords) {  //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
               $title = (isset($iptc['Title'])) ? $iptc['Title'] : $title;
               $caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
               $keywords = (isset($iptc['Keywords'])) ? implode(' ',$iptc['Keywords']) : $keywords;


add after:
               $title  = utf8_encode(html_entity_decode($title, ENT_NOQUOTES));
               $caption = utf8_encode(html_entity_decode($caption, ENT_NOQUOTES));
               $keywords = utf8_encode(html_entity_decode($keywords, ENT_NOQUOTES));               


It works...

a) ... if your IPTC-'special characters' are encoded as html-entities. I don't know if that's the case with your pics. If it won't work, you maybe just have to change/replace the php-functions (like html_entity_decode) accordingly to en/decode them correctly. For me (german umlauts) it works with IPTC-Data written by www.xnview.com.

b) ... only with newly added pics. To reload the IPTC-Data of existing pics to the CPG database I've done another quick&dirty hack that 'enhances' the "Reload file dimensions and size information"-admin tool to reload the IPTC-Data as well.

Maybe it's helpful, maybe it's not  ;)

spiros71

Hi lamama,

Thanks for your kind help! I tried it, but still skips the Greek. The program originally used for photo management was fotostation pro.
http://www.fotoware.com/Products/FotoStationPro/FeatureOverview.aspx

You can see one of the pics I used here
http://www.translatum.gr/gallery/displayimage-lastup-0-0.html

Joachim Müller

You're using cpg1.4.5, while the most recent stable release currently is cpg1.4.14, so you're running 9 (!!) versions behind. It is absolutely mandatory to upgrade asap no matter what!