Author Topic: Auto IPTC into discription field when check new images  (Read 31956 times)

0 Members and 1 Guest are viewing this topic.

Offline fotograf

  • Newbie
  • *
  • Posts: 26
    • View Profile
Auto IPTC into discription field when check new images
« on: October 04, 2002, 06:17:09 AM »
I want, that after loading new the image on FTP, and start of command CHECK NEW IMAGES, there were new images and the information from IPTC info DISCRIPTIN was automatically transferred. If somebody knows as to make it inform me please.
My English too bad.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Auto IPTC into discription field when check new images
« Reply #1 on: October 04, 2002, 08:46:16 AM »
Try this. Open "admin/checkimages.php" an replace
Code: [Select]
show_textarea_row($title, "image_description_".$i, "", $textarea_size);
with
Code: [Select]
$caption = "";
if ($imageinfo = @getimagesize($file_src, $info)) {
  if (isset($info['APP13'])) {
    $iptc = iptcparse($info['APP13']);
    if (is_array($iptc)) {
      $caption = (isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";
    }
  }
}
show_textarea_row($title, "image_description_".$i, $caption, $textarea_size);


Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #2 on: October 04, 2002, 07:32:01 PM »
Great, just what i'm looking for, but i need also the keywords and the date created
Do i just have to copy the line of the caption and chance the line or can you place a example

again great, save a lot of work

Offline fotograf

  • Newbie
  • *
  • Posts: 26
    • View Profile
Auto IPTC into discription field when check new images
« Reply #3 on: October 04, 2002, 08:08:57 PM »
Unfortunately. Has not helped. Mistakes any did not give out. But the information from IPTC automatically in a field of the description was not transferred :cry:
I am sorry for my bad English. It is machine translation..
My English too bad.

Offline fotograf

  • Newbie
  • *
  • Posts: 26
    • View Profile
Auto IPTC into discription field when check new images
« Reply #4 on: October 04, 2002, 08:15:44 PM »
Yes, it would be excellent if the information from IPTC would automatically be transferred to corresponding fields at performance of command CHECK NEW IMAGES. whether it has turned out at you with replacement of a code, at me is not present. If it only at me does not go, can you send to me  the file modified by you. I shall be very grateful.
My English too bad.

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #5 on: October 04, 2002, 08:20:53 PM »
i think you made a mistake because with me it it was transferred fine
i'm trying to set the date alsop but this doesn't go well till now

Offline fotograf

  • Newbie
  • *
  • Posts: 26
    • View Profile
Auto IPTC into discription field when check new images
« Reply #6 on: October 04, 2002, 08:34:02 PM »
I shall search where I have made a mistake. Thanks.
My English too bad.

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #7 on: October 04, 2002, 08:38:45 PM »
Jan or Nicky, can you help me out with the date part, i can't get this working

My experience with PHP is zero

Offline fotograf

  • Newbie
  • *
  • Posts: 26
    • View Profile
Auto IPTC into discription field when check new images
« Reply #8 on: October 04, 2002, 09:33:59 PM »
And to me help too, please. When I allow command CHECK NEW IMAGES and I note DETAILED VERSION I see, THAT the INFORMATION is transferred from IPTC but after I press ADD button and I come into viewing gallery the field of the description is empty. I think to many users of your gallery it will be convenient if descriptions both key words and date will be automatically filled, at check of new images. Make, please, for us a new file checkimages.php. Let your script becomes even better.
My English too bad.

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Auto IPTC into discription field when check new images
« Reply #9 on: October 05, 2002, 09:10:50 AM »
See the first function get_iptc_insert_link() in "admin/admin_functions.php". There you will find the code how to handle the date and the keywords.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #10 on: October 05, 2002, 11:56:44 AM »
i tried but i'm getting a parse fault on line 342 or something like that.

please can you try to explain it for me again what i should do

regards
edwin

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Auto IPTC into discription field when check new images
« Reply #11 on: October 05, 2002, 12:11:05 PM »
Replace

Code: [Select]
$caption = (isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";

with
Code: [Select]
if (isset($iptc['2#055'][0])) {
  $caption = $iptc['2#055'][0];
  $caption = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $caption);
}

for date

or

Code: [Select]
if (isset($iptc['2#025'])) {
  $caption = "";  
  foreach ($iptc['2#025'] as $val) {
    $caption .= (($caption != "" ) ? " " : "").$val;
  }
}

for keywords

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #12 on: October 05, 2002, 01:15:17 PM »
i'm very sorry Jan but this doesn't automaticly puts in the created date in the datefield but in the captionfield.
What do i have to change to get the setting right for the date field
i tought it hat to be changed in this part

    $date = date("Y-m-d H:i:s", time());
      $title = $lang['field_date'].$lang['date_desc'].$lang['date_format'].((isset($file_src)) ? get_iptc_insert_link($file_src, "date_created", "image_date_".$i, 0) : "");
      show_input_row($title, "image_date_".$i, $date, $textinput_size);

Please, help me so this program wil be perfect for me

PS. i'm using 1.6 mayby 1.7 is different

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Auto IPTC into discription field when check new images
« Reply #13 on: October 05, 2002, 01:33:33 PM »
Place
Code: [Select]
if ($imageinfo = @getimagesize($file_src, $info)) {
  if (isset($info['APP13'])) {
    $iptc = iptcparse($info['APP13']);
    if (is_array($iptc)) {
      if (isset($iptc['2#055'][0])) {
        $date = $iptc['2#055'][0];
        $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $date);
      }
    }
  }
}

after
Code: [Select]
$date = date("Y-m-d H:i:s", time());
Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
Auto IPTC into discription field when check new images
« Reply #14 on: October 05, 2002, 01:43:20 PM »
YES YES YES YES YES YES YES YES YES YES  :D  :D  :D  :D  :D
 :)
      :wink:

                :P

YOU ARE THE MASTER

thank you, very well

regards edwin