4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: rsorbo on December 13, 2002, 02:58:59 AM

Title: No Search Results Problem...
Post by: rsorbo on December 13, 2002, 02:58:59 AM
Hello:

When trying some searches on known material in my database no results are coming up .
I've tried re-indexing but that didn't fix it.
The images in question and the IPTC meta data do show up in a catagory search.
The images were keyworded using IPTC in Photoshop and/or Fotostation if that makes a difference.
Any ideas?
Thanks in advance.

Rob
Title: No Search Results Problem...
Post by: Jan on December 13, 2002, 10:57:33 AM
The search will not go through the IPTC data. Only the database fileds image name, description and keywords will be used.

Jan
Title: No Search Results Problem...
Post by: rsorbo on December 13, 2002, 07:12:47 PM
Is it possible to have this functionality?
Possibly copying or somehow linking the keywords and caption from the IPTC into the 4images description/keywords fields during uploading or checking for new images or somewhere else in the process?
I would like to not have to re-keyword 800+ images.
Thanks.

Rob
Title: No Search Results Problem...
Post by: rsorbo on December 14, 2002, 02:10:03 AM
Hello Jan:

Is this what I'm looking for?

http://www.4homepages.de/forum/viewtopic.php?t=2100&highlight=iptc

Would I then just have to re-upload the images and "check new images?"
Thanks

Rob
Title: No Search Results Problem...
Post by: Jan on December 16, 2002, 10:56:21 AM
Yes

Jan
Title: No Search Results Problem...
Post by: rsorbo on December 16, 2002, 10:38:55 PM
Hello Jan:

Okay...tried this first but got a parse error line 298:
I'm using 1.7. Can you help?
After getting this part working I would also like to add the IPTC keywords to the Description keywords field as well. What would I need to change for this to happen?

Open "admin/checkimages.php" an replace
Code:
show_textarea_row($title, "image_description_".$i, "", $textarea_size);
with
Code:
$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);

Thanks again,

Rob
Title: No Search Results Problem...
Post by: Jan on December 17, 2002, 09:30:13 AM
Add
Code: [Select]
foreach ($iptc['2#025'] as $val) {
  $caption .= (($caption != "" ) ? " " : "").$val;
}

after
Code: [Select]
$caption = (isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";
Jan
Title: No Search Results Problem...
Post by: rsorbo on December 17, 2002, 06:05:13 PM
Hi Jan:

Thanks for your continued help, but I'm still getting the same error.
Here's what the code looks like after I paste everything in under admin/checkimages.php:

 $title = $lang['field_description_ext'].((isset($file_src)) ? get_iptc_insert_link($file_src, "caption", "image_description_".$i) : "");
     $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] : "";
       foreach ($iptc['2#025'] as $val) {
  $caption .= (($caption != "" ) ? " " : "").$val;
      }
    }
  }
}
show_textarea_row($title, "image_description_".$i, $caption, $textarea_size);

Am I missing something?

Rob
Title: No Search Results Problem...
Post by: Jan on December 18, 2002, 09:18:15 AM
In which line you get the error message?

Jan
Title: No Search Results Problem...
Post by: rsorbo on December 18, 2002, 04:20:35 PM
Parse line 298
Title: No Search Results Problem...
Post by: Jan on December 18, 2002, 04:38:14 PM
What line in the code you posted above ;)

Jan
Title: No Search Results Problem...
Post by: rsorbo on December 18, 2002, 05:53:02 PM
Well...when using the goto line in Word it doesn't end up in that code but above it on:
elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".gif")) {
      $thumb_file = $image_name.".gif";
So, I'm not sure how to help you on this...?
I only received the parse line 298 error after pasting in the code so I can't imagine the problem is somewhere else.
Any ideas?
Thanks agiain,

Rob
Title: No Search Results Problem...
Post by: Jan on December 19, 2002, 08:42:22 AM
Do you use Word to edit the php files? I hope not! Please use a text editor like Ultra Edit (http://www.ultraedit.com)...

Jan
Title: No Search Results Problem...
Post by: rsorbo on December 19, 2002, 07:59:06 PM
No, I use SimpleText on a Mac.
It just doesn't have the ability to goto a given line so I use Word for that.
Any further help you can provide is much appreciated.
Thanks Jan.
Title: No Search Results Problem...
Post by: Jan on December 20, 2002, 09:27:49 AM
Send me the file by email: jan@4homepages.de

Jan
Title: No Search Results Problem...
Post by: Jan on December 20, 2002, 08:42:35 PM
I see some strange characters in the part you edited. Try another text editor, ie BBEdit (http://www.barebones.com/products/bbedit.html).

Jan
Title: No Search Results Problem...
Post by: bernd on December 20, 2002, 11:24:13 PM
Jan is right. If you are on a mac there is no better editor than BBEdit. They have a demo available - or if you can live without code coloring and other gimmicks they have a Lite version that is free - see here (http://www.barebones.com/products/bbedit_lite.html) for more info. With BBEdit you can just open the file and let it display the line numbers for you.

cheers,
Bernd
Title: No Search Results Problem...
Post by: rsorbo on December 21, 2002, 12:06:29 AM
Same error even using BBEdit... :cry:
Title: No Search Results Problem...
Post by: rsorbo on December 29, 2002, 07:48:18 PM
Hello Jan:

Thanks for the file.
I tried it out and didn't get the error but it didn't work as a couple of other issues arose.
It's still not adding the IPTC info from the images into the Description field.
And when I check new images it's not showing the thumbnails I've uploaded along with the media files. I FTP'd directly into their respected folders like always, but no thumbs.
I tried it twice just to make sure it wasn't something I was doing.
Any ideas?
Thanks

Rob
Title: Auto IPTC Import
Post by: rsorbo on January 04, 2003, 08:09:11 PM
Does anyone else on this forum use IPTC (Photoshop "File Info") for adding
caption/keywords to their images?
I've tried Jan's code but it still doesn't copy the caption field into the description field.
I figured out why the thumbs weren't showing up, but still would like to nail down this other issue. It would make things so much easier to have this data automatically copy over.
I'd like to do the same for the IPTC keywords to Description keywords but for now, I'd settle just the caption info.
I'm using 1.7.
I understand others have gotten it to work in 1.6 but I'd really like to know if it's possible under 1.7 before having to downgrade.
Here is the new checkimages.php code that Jan sent me. If anyone can test this or has gotten it to work, please let me know.
Thanks
Rob

File: checkimages.php
Replace (line309):

$title = $lang['field_description_ext'].((isset($file_src)) ? get_iptc_insert_link($file_src, "caption", "image_description_".$i) : "");
      show_textarea_row($title, "image_description_".$i, "", $textarea_size);

With:

$title = $lang['field_description_ext'].((isset($file_src)) ? get_iptc_insert_link($file_src, "caption", "image_description_".$i) : "");
      $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] : "";
            foreach ($iptc['2#025'] as $val) {
              $caption .= (($caption != "" ) ? " " : "").$val;
            }  
          }
        }
      }
      show_textarea_row($title, "image_description_".$i, $caption, $textarea_size);
Title: No Search Results Problem...
Post by: Jan on January 05, 2003, 10:58:36 AM
Did you used the "detailed version" while adding new images? The description field must be visible.

Jan
Title: No Search Results Problem...
Post by: rsorbo on January 05, 2003, 07:49:44 PM
Jan:

It worked!
Thanks for your patience on this.
Now can I get the keywords and date created fields to automatically populate by using the same code, but replacing the IPTC code numbers with #025 and #055 in checkimages.php file under their respected lines of code? It does work manually using the IPTC button. I just have to reload 800 images and need it done automatically.
Thanks again!

Rob  :D
Title: No Search Results Problem...
Post by: Jan on January 05, 2003, 07:52:45 PM
Yes, this should work.

Jan
Title: No Search Results Problem...
Post by: rsorbo on January 05, 2003, 07:54:30 PM
Thanks!
Title: No Search Results Problem...
Post by: rsorbo on January 06, 2003, 07:04:43 PM
Hello again:

Two questions:

I've got the keywords importing fine.
The "date created", however, copies over twice into the "Description" date field.
What part of the code below do I have to remove so only one date imports?
Also to get all this updated information into the catagory databases do I have to delete all the images and categories and start over or is there another way?
When I delete the thumbs/previews, reload them and checkimages they don't show up. They're still show as already in the database. I tried re-indexing after deleting but that didn't help.

Date created code (checkimages.php):

$date = "";
      if ($imageinfo = @getimagesize($file_src, $info)) {
        if (isset($info['APP13'])) {
          $iptc = iptcparse($info['APP13']);
          if (is_array($iptc)) {
            $date = (isset($iptc['2#055'][0])) ? $iptc['2#055'][0] : "";
            foreach ($iptc['2#055'] as $val) {
              $date .= (($date != "" ) ? " " : "").$val;
            }  
          }
        }
      }
      show_input_row($title, "image_date_".$i, $date, $textinput_size);

Thanks

Rob
Title: No Search Results Problem...
Post by: rsorbo on January 06, 2003, 08:18:11 PM
I figured out the date duplication issue.
Still don't know about the second one...
Title: No Search Results Problem...
Post by: Jan on January 07, 2003, 09:37:40 AM
Quote from: rsorbo
Also to get all this updated information into the catagory databases do I have to delete all the images and categories and start over or is there another way

No, sorry.
Quote
When I delete the thumbs/previews, reload them and checkimages they don't show up. They're still show as already in the database. I tried re-indexing after deleting but that didn't help.

"Check new images" only checks for really new images (main file and thumbnail). You have to remove the whole image entry first.

Jan