I'm trying to upgrade from 1.2.7 (just to 1.2.8 to start with) and I've encountered what I think is a change in the functionality of getImageTitle.
In my system, I use the file name as part of the page header and I put the caption below.
I used getImageTitle to get the file name and printImageDesc to print the caption.
Now getImageTitle seems to be showing the caption if there is one, and the file name if there isn't a caption. getImageDesc seems to do almost the same thing, but just shows blank if there's no caption.
Is there a function that I can use that just fetches the file name?
Thanks in advance!
Comments
getImageDesc() shows the description. It shows of course nothing if you did not add anything on the backend or again prior to uploading via meta data.
`$_zp_current_image->filename` gets the file name of the current image if in image context.
i edit my photos in Lightroom, add a caption, and export them for ZP. when I import them into ZP, they show up with BOTH the title and desc showing the caption that i input in Lightroom. perhaps this didn't happen back in 1.2.7 because i'm certain that functionality i used to observe is correct. so my theory is that when i imported previously the Title field was not filled in; only the description field.
is there any way to import such that the caption only flows into the Description field? it seems silly to populate both fields with the same thing.
Zenphoto follows the EXIF/IPTC specification:
The image title comes from one of the followind (in priority order)
IPTC Object Name
IPTC Image Headline
EXIF Description[sic]
if none of these are set it uses the defaulttitle (the display name)
The description comes from:
IPTC Image Caption
Regards EXIF Description--see Table 3 TIFF Rev. 6.0 Attribute Information Used in Exif of the spec. There you will find under D. Other tags "Image title ImageDescription 270 10E"
All this is unchanged. However there may have been issues in the past of not processing the metadata at the proper point in the image instantiation sequence such that the default title might have already been set.
Anyway, it would seem that lightroom is storing the description in the title field as well as the IPTC Image Caption. That is the only way it can show up in both the ZP title and ZP description.
did ZP use the title field in previous versions? i'm assuming it did, but i don't have an old version running. i think i would have noticed if i had a duplicate field. i'm wondering if somehow the upgrade from a previous version could have populated the fields this way. this sounds strange, but i'm just fishing for possibilities now.
all i can say for certain is that i had a previously functioning gallery where i used getImageTitle to fetch the actual file name. i don't know if that means it was fetching a copy of the file name that had been somehow copied into the title field, however. i DO know that it definitely worked, and worked whether or not i had a caption attached to the photo.
i've solved the problem by writing some new code, but i'm still very curious about what happened.
when you say that the object title comes from:
IPTC Object Name
IPTC Image Headline
EXIF Description[sic]
does that mean that ZP fills it in during import based on that priority?
trying to use Acrylian's suggestion of $_zp_current_image->filename
currently my code looks like:
`<?php print convert_to_filename ( getFullImageURL() ); ?>`
how would i write this using $_zp_current_image->filename?
obviously the following is incorrect ('cause i tried it):
`<?php print $_zp_current_image->filename; ?>`
What was wrong with your code above? If I understand what you want, it should be doing it.
EDIT: the above was written before seeing Acrylian's post. i guess i have to move the code since i'm assuming there's no way to do what i asked above. is that correct?
If this was not the case, then the code should throw a PHP error. You should check your error log.