4images Forum & Community
4images Issues / Ausgaben => Installation, Update & Configuration => Topic started 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
-
The search will not go through the IPTC data. Only the database fileds image name, description and keywords will be used.
Jan
-
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
-
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
-
Yes
Jan
-
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
-
Add
foreach ($iptc['2#025'] as $val) {
$caption .= (($caption != "" ) ? " " : "").$val;
}
after
$caption = (isset($iptc['2#120'][0])) ? $iptc['2#120'][0] : "";
Jan
-
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
-
In which line you get the error message?
Jan
-
Parse line 298
-
What line in the code you posted above ;)
Jan
-
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
-
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
-
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.
-
Send me the file by email: jan@4homepages.de
Jan
-
I see some strange characters in the part you edited. Try another text editor, ie BBEdit (http://www.barebones.com/products/bbedit.html).
Jan
-
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
-
Same error even using BBEdit... :cry:
-
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
-
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);
-
Did you used the "detailed version" while adding new images? The description field must be visible.
Jan
-
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
-
Yes, this should work.
Jan
-
Thanks!
-
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
-
I figured out the date duplication issue.
Still don't know about the second one...
-
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.
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