4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2018, 08:54:09 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Requests & Discussions) (Moderators: mawenzi, Rembrandt)
| | |-+  Auto IPTC into discription field when check new images
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3 » »» Print
Author Topic: Auto IPTC into discription field when check new images  (Read 24277 times)
fotograf
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 0
-Receive: 0


View Profile
« 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.
Logged

My English too bad.
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 31


View Profile WWW
« Reply #1 on: October 04, 2002, 08:46:16 AM »

Try this. Open "admin/checkimages.php" an replace
1
show_textarea_row($title, "image_description_".$i, "", $textarea_size);

with
1
2
3
4
5
6
7
8
9
10
$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
Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« 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
Logged
fotograf
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 0
-Receive: 0


View Profile
« 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 Crying or Very sad
I am sorry for my bad English. It is machine translation..
Logged

My English too bad.
fotograf
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 0
-Receive: 0


View Profile
« 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.
Logged

My English too bad.
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« 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
Logged
fotograf
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 on: October 04, 2002, 08:34:02 PM »

I shall search where I have made a mistake. Thanks.
Logged

My English too bad.
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« 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
Logged
fotograf
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 0
-Receive: 0


View Profile
« 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.
Logged

My English too bad.
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 31


View Profile WWW
« 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
Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« 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
Logged
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 31


View Profile WWW
« Reply #11 on: October 05, 2002, 12:11:05 PM »

Replace

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


with
1
2
3
4
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

1
2
3
4
5
6
if (isset($iptc['2#025'])) {
  $caption = "";  
  foreach ($iptc['2#025'] as $val) {
    $caption .= (($caption != "" ) ? " " : "").$val;
  }
}

for keywords

Jan
Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« 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
Logged
Jan
Administrator
4images Guru
*****
Offline Offline

Posts: 5024

Thank You
-Given: 0
-Receive: 31


View Profile WWW
« Reply #13 on: October 05, 2002, 01:33:33 PM »

Place
1
2
3
4
5
6
7
8
9
10
11
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
1
$date = date("Y-m-d H:i:s", time());

Jan
Logged

Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search
edwin
Full Member
***
Offline Offline

Posts: 199

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #14 on: October 05, 2002, 01:43:20 PM »

YES YES YES YES YES YES YES YES YES YES  Very Happy  Very Happy  Very Happy  Very Happy  Very Happy
 Smile
      Wink

                Razz

YOU ARE THE MASTER

thank you, very well

regards edwin
Logged
Pages: [1] 2 3 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.052 seconds with 19 queries.
Post your comments here