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

0 Members and 1 Guest are viewing this topic.

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 #30 on: May 20, 2003, 09:56:21 AM »
For keywords, replace
Code: [Select]
show_textarea_row($title, "image_keywords_".$i, "", $textarea_size);
with
Code: [Select]
$keywords = "";
if ($imageinfo = @getimagesize($file_src, $info)) {
  if (isset($info['APP13'])) {
    $iptc = iptcparse($info['APP13']);
    if (is_array($iptc)) {
      if (isset($iptc['2#025'])) {
        foreach ($iptc['2#025'] as $val) {
          $keywords .= (($value != "" ) ? " " : "").$val;
        }
      }
    }
  }
}
show_textarea_row($title, "image_keywords_".$i, $keywords, $textarea_size);
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Yogen

  • Newbie
  • *
  • Posts: 25
    • View Profile
Auto IPTC into discription field when check new images
« Reply #31 on: May 20, 2003, 03:28:19 PM »
hallo jan,

erstmal danke für die anleitung!!
wegen der anderen user hier schreibe ich mal in englisch! ;-)

--------------
i replaced... and then i tested many times but nothing would imported into the description field :-(

as i wrote before, i use 1.7 and i don't know how to fix the problem. maybe the IPTC infos are not in a correct form?
i testet all, with comma, without, all i can do!!

do you have any suggestions about the form, or any other idea why it doesn't work ??
jan, did you tested your hack by yourself ?

greetz and thnx very much!

Yogen
PS: is there any other user now, whow uses the hack and it works ??

Offline mdevane

  • Pre-Newbie
  • Posts: 5
    • View Profile
Auto IPTC into discription field when check new images
« Reply #32 on: May 24, 2003, 09:21:44 PM »
Quote from: Jan
For keywords, replace
Code: [Select]
show_textarea_row($title, "image_keywords_".$i, "", $textarea_size);
with
Code: [Select]
$keywords = "";
if ($imageinfo = @getimagesize($file_src, $info)) {
  if (isset($info['APP13'])) {
    $iptc = iptcparse($info['APP13']);
    if (is_array($iptc)) {
      if (isset($iptc['2#025'])) {
        foreach ($iptc['2#025'] as $val) {
          $keywords .= (($value != "" ) ? " " : "").$val;
        }
      }
    }
  }
}
show_textarea_row($title, "image_keywords_".$i, $keywords, $textarea_size);


Jan - when I tested this mod, it does autopopulate the keywords field, but each IPTC keyword in my images is delimited by <CR>, and the autopopulate mod concatenates the fields together into a single string in 4images.  When I use the built-in standard manual feature on the same images, it works perfectly and the fields are delimited by spaces, as they should be.

Can you review the code to verify my problem?  It is possible that keywords may be delimited by different characters (<CR>, <,>, <tab>, etc.), depending on the system which was used to create them.
Thanks, Mark

Offline mdevane

  • Pre-Newbie
  • Posts: 5
    • View Profile
Auto IPTC into discription field when check new images
« Reply #33 on: May 29, 2003, 04:24:05 AM »
Bump

Jan - Any suggestions on how to fix this bug?  Can't publish site without it.

thx much for your help.
Thanks, Mark

Offline hansprdn

  • Pre-Newbie
  • Posts: 1
    • View Profile
Auto IPTC into discription field when check new images
« Reply #34 on: June 02, 2003, 04:50:41 PM »
Jan I have the same problem.

keywords entered and no space between keywords!

please help

Offline mdevane

  • Pre-Newbie
  • Posts: 5
    • View Profile
Auto IPTC into discription field when check new images
« Reply #35 on: June 21, 2003, 05:37:53 AM »
bump!
Thanks, Mark

Offline Schwarzer'Engel

  • Newbie
  • *
  • Posts: 18
    • View Profile
Auto IPTC into discription field when check new images
« Reply #36 on: June 22, 2003, 12:17:56 PM »
Quote from: mdevane
Jan - First of all - Excellent program  :D .  I am considering building a few new sites for my kids' sports teams.  I would like to use 4images, but I typically shoot 100-150 pictures per sports event 4-5 times per week, and I use a batch IPTC editor to add captions, keywords, etc as part of my standard workflow.  
Hello,

which IPTC-Batch-Editor use You?

Greets
Chris

Offline Schwarzer'Engel

  • Newbie
  • *
  • Posts: 18
    • View Profile
Auto IPTC into discription field when check new images
« Reply #37 on: June 22, 2003, 12:27:51 PM »
Quote from: hansprdn
Jan I have the same problem.

keywords entered and no space between keywords!

please help


Hello,

replace
Code: [Select]
$keywords .= (($value != "" ) ? " " : "").$val;

with
Code: [Select]
$keywords .= (($value != "" ) ? " " : " ").$val;

You have now Space-separeted Keywords, but before the first Keyword you have an Space, but this is not a Problem. (Sorry for My Bad English).

Greets
Chris