[Feature Request]: IPTC import

Phoca Gallery - image gallery extension
Wolfgang
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 25 Nov 2010, 21:51

Re: [Feature Request]: IPTC import

Post by Wolfgang »

Well, in XMP-Data a lot of information may be stored. In particular one field holds the description of the picture. This can be used as source for the description displayed beneath the picture in Gallery. However, how to deal with multi-language sites?

This is where my suggestion comes in: The XMP 'Alternate Language' tag allows to store different language descriptions within one JPG. Upon displaying the Gallery may pick the language currently selected.

Another topic is about downloading pictures from the Gallery by visitors. Currently, it is possible to attach Captions and Descriptions to pictures, as well as geo-data, time-stamps a.s.o. These data do not neccessarily comply with the data stored inside the XMP / IPTC data fields of the JPG-file. My second suggestion is, that upon visitor's request for download, a file with freshly written IPTC / XMP will be delivered to make sure that the data dispalyed from Gallery and the data inside the JPG match.

Regards and many thanks for the Gallery so far...
Wolfgang
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49133
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feature Request]: IPTC import

Post by Jan »

Hi, I think such solution will be not so easy to be implemented :-(
If you find Phoca extensions useful, please support the project
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: [Feature Request]: IPTC import

Post by jamfx »

Hi Jan,

I couldn't find any info about this topic. Is ITPC-Info now supported in your beautiful Gallery?
Please let me know.
Thanks
JamFX
dethisandthat
Phoca Member
Phoca Member
Posts: 13
Joined: 17 Sep 2010, 11:09

Re: [Feature Request]: IPTC import

Post by dethisandthat »

I believe right now phoca gallery able to display EXIF infos on a pop up scrren at the gallery detail level. There is no support now to display EXIF info as your image description. You have to customize the php files to display such infos.

The code to extract EXIF infos could be found in \Joomla\components\com_phocagallery\front\views\info\view.html.php
To display EXIF info in category detail level you need to edit file \Joomla\components\com_phocagallery\views\category\tmpl\default.php

If you want to display XMP infos such as Camera Model and Lense, then you need to use 3rd library such as PHP_JPEG_Metadata_Toolkit_1.11, which support EXIF as well.
jamfx
Phoca Enthusiast
Phoca Enthusiast
Posts: 61
Joined: 08 Mar 2009, 09:26
Contact:

Re: [Feature Request]: IPTC import

Post by jamfx »

Sorry,
this wasn't my question. I found out myself, that Exif-Data are supported. My question was about ITPC-Data, which are inserted manually and mostly used by professional photographers.

Thanks
JamFX
dethisandthat
Phoca Member
Phoca Member
Posts: 13
Joined: 17 Sep 2010, 11:09

Re: [Feature Request]: IPTC import

Post by dethisandthat »

I dont think IPTC is supported directly. You have to customize your code to include it.

Below is a snippet of my code.

\Joomla\components\com_phocagallery\views\category\tmpl\default.php

Code: Select all

$info = array();
$data['keywords'] = '';
$data['description'] = '';
$size = getimagesize($fullfileName, $info);
if (isset($info['APP13'])) {
    // IPTC 
    $iptc_php = iptcparse($info['APP13']);
    if (is_array($iptc_php)) {
        $data['description'] = $iptc_php["2#120"][0];
        $data['keywords'] = joinArray($iptc_php["2#025"], ', ');
    }
}
echo ' title="'. $data['keywords'].'"';
Some IPTC info I found from web

Code: Select all

Iptc.Envelope.CharacterSet	1#090
Iptc.ObjectName			2#005	
Iptc.Category			2#015
Iptc.Supplementals		2#020
Iptc.Keywords			2#025
Iptc.SpecialsInstructions	2#040
Iptc.DateCreated		2#055
Iptc.TimeCreated		2#060
Iptc.DigitalCreationDate	2#062
Iptc.DigitalCreationTime	2#063
Iptc.ByLine			2#080
Iptc.ByLineTitle		2#085
Iptc.City			2#090
Iptc.Sublocation		2#092
Iptc.ProvinceState		2#095
Iptc.CountryCode		2#100
Iptc.CountryName		2#101
Iptc.Headline			2#105
Iptc.Credits			2#110
Iptc.Source			2#115
Iptc.Copyright			2#116
Iptc.Contact			2#118
Iptc.Caption			2#120
Iptc.CaptionWriter		2#122
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49133
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feature Request]: IPTC import

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
phidias81
Phoca Enthusiast
Phoca Enthusiast
Posts: 70
Joined: 05 Jan 2012, 01:20
Contact:

Re: [Feature Request]: IPTC import

Post by phidias81 »

Any news about ITCP and XMP import feature? I think it's a very important feature for people willing to index their photos. That would be very useful for google image indexing. It would be great also if it would be possible where to import it,Description (caption), meta description or meta keywords.

It would also nice to have for each of Description, meta desc and keywords, an "import from" field. In example I could set to import meta keywords from the IPTC keywords field. If not possible it would be a workaround also to import description from filename in example (the same as the ALT value), since it's possible to rename the files adding the keywords and tags through "Exiftool".

Code: Select all

exiftool -sep "-" "-filename<${city;}-${country-primarylocationname;}-${keywords;}_%f.%e" DIR
I also tried to add the code suggested on top in the file
\Joomla\components\com_phocagallery\views\category\tmpl\default.php
and after it was not working I tried also in \Joomla\components\com_phocagallery\views\detail\tmpl\default.php

I put it at the end of the files right before ?>, but nothing is imported. Maybe I put it in the wrong position?
Probably from 2011 something is changed. A quick fix of that code would be good enough while waiting for the feature to be implemented in phoca. If anybody know how to fix it, he is very welcome :)

Code: Select all

$info = array();
$data['keywords'] = '';
$data['description'] = '';
$size = getimagesize($fullfileName, $info);
if (isset($info['APP13'])) {
    // IPTC
    $iptc_php = iptcparse($info['APP13']);
    if (is_array($iptc_php)) {
        $data['description'] = $iptc_php["2#120"][0];
        $data['keywords'] = joinArray($iptc_php["2#025"], ', ');
    }
}
echo ' title="'. $data['keywords'].'"';
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49133
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feature Request]: IPTC import

Post by Jan »

Hi, still nothing changed there :-( :-( ... the highest priority is to adapt extensions to changes of Joomla! (there are really large changes which are made very quickly, so I hope sometimes the changes in Joomla! will be not so dramatic and I will be able to look at this :-( :-( )
https://www.phoca.cz/phoca-needs-your-help/

Jan
If you find Phoca extensions useful, please support the project
Post Reply