Page 1 of 2

IPTC

Posted: 19 May 2010, 16:27
by el_professor
Hi, I've seen in the update log that in Imagevue X2.1.7, the support of IPTC has been added. How can it be used ?

Posted: 20 May 2010, 05:05
by Nick
Basically Imagevue just auto-fills titles and descriptions for images from IPTC data and displays IPTC/EXIF info alongside the image in admin and when you are viewing it.

Posted: 20 May 2010, 05:12
by el_professor
Actually, in my case it's not. There's nothing to configure ? Or any prequisites ?

Posted: 20 May 2010, 05:40
by Nick
Actually it should just work, could you provide a link to your gallery and Imagevue Control Panel login please? We'd like to take a look and sample some of your image to see if they actually contain IPTC data?

Posted: 20 May 2010, 07:09
by el_professor
The field i'm using is the "Object Name" (the official IIM field for the title). Is it correct ? Maybe you are using the field "headline"

Posted: 20 May 2010, 07:31
by el_professor
Yes, i found you're using 2#105, which is headline, to fill title for image. Many sofwares use ObjectName and not Headline for titles (lightroom, ps ...).
IMHA you should first use headline and if empty use objectname, or best : let the user choose.

An other improvment would be to sort files with IPTC date field.

Posted: 20 May 2010, 07:42
by el_professor
Ok i've made change to collect objetname instead of headline, but if the field contains special caracters (à ,é,è...), the title is not fullfilled.

(sorry to flood the topic, but i wanted to let you know of my progress !)

Posted: 21 May 2010, 08:52
by el_professor
I've made a workaround to my problem (only a workaround for ISO-8859-1 characters).

I've modified 2 files :

- /imagevue/include/ivFileImageClass.php
Previous code :
function _initAttributes()
{
parent::_initAttributes();
if ((is_null($this->getAttribute('title')) || is_null($this->getAttribute('description')))) {
$iptcData = $this->iptcReadData();
if (is_array($iptcData)) {
if (is_null($this->getAttribute('title')) && isset($iptcData['2#105'][0])) {
$title = trim($iptcData['2#105'][0]);
if (!empty($title)) {
$this->setAttribute('title', $title);
$this->_setState(STATE_DIRTY);
}
}
if (is_null($this->getAttribute('description')) && isset($iptcData['2#120'][0])) {
$description = trim($iptcData['2#120'][0]);
if (!empty($description)) {
$this->setAttribute('description', $description);
$this->_setState(STATE_DIRTY);
}
}
}
}

New code (bold charracters added) :

function _initAttributes()
{
parent::_initAttributes();
if ((is_null($this->getAttribute('title')) || is_null($this->getAttribute('description')))) {
$iptcData = $this->iptcReadData();
if (is_array($iptcData)) {
if (is_null($this->getAttribute('title')) && isset($iptcData['2#005'][0])) {
$title = utf8_encode(trim($iptcData['2#005'][0]));
if (!empty($title)) {
$this->setAttribute('title', $title);
$this->_setState(STATE_DIRTY);
}
}
if (is_null($this->getAttribute('description')) && isset($iptcData['2#120'][0])) {
$description = utf8_encode(trim($iptcData['2#120'][0]));
if (!empty($description)) {
$this->setAttribute('description', $description);
$this->_setState(STATE_DIRTY);
}
}
}
}

The replacement of 2#105 (= iptc Headline) by 2#005 (=iptc ObjectName) solve the problem of using ObjectName to fill the title of photos.
The "ut8_encode' function permit to correctly read accentuated characters in iptc title and description (UTF8_Encode convert ISO-8859-1 to UTF-8, it's transparent to ascii characters). => it's just a workaround as it doesn't address all charactersets.

- /imagevue/include/ivIptcParser.class.php
Previous code :
function parse($iptcData)
{
if (is_array($iptcData)) {
$parsedData = array();
foreach ($iptcData as $key => $value) {
if (array_key_exists($key, $this->_allowedTags)) {
$value = count($value) > 1 ? $value : $value[0];
switch ($key) {
case '1#000':
// break intentionally omitted
case '1#022':
$value = hexdec(bin2hex($value));
break;
case '1#020':
// break intentionally omitted
case '2#200':
$value = $this->_getFileFormat(hexdec(bin2hex($value)));
break;
case '1#090':
$value = $this->_getCharacterSet($value);
break;
case '2#000':
$value = hexdec(bin2hex($value));
break;
case '1#070':
// break intentionally omitted
case '2#030':
// break intentionally omitted
...
...
...
case '2#150':
$value = $this->_getAudioType($value);
break;
case '2#130':
$value = $this->_getImageType($value);
break;
}
$parsedData[$this->_allowedTags[$key]] = $value;
}
}

New code (bold word has been added) :
function parse($iptcData)
{
if (is_array($iptcData)) {
$parsedData = array();
foreach ($iptcData as $key => $value) {
if (array_key_exists($key, $this->_allowedTags)) {
$value = count($value) > 1 ? $value : $value[0];
switch ($key) {
case '1#000':
// break intentionally omitted
case '1#022':
$value = hexdec(bin2hex($value));
break;
case '1#020':
// break intentionally omitted
case '2#200':
$value = $this->_getFileFormat(hexdec(bin2hex($value)));
break;
case '1#090':
$value = $this->_getCharacterSet($value);
break;
case '2#000':
$value = hexdec(bin2hex($value));
break;
case '1#070':
// break intentionally omitted
case '2#030':
// break intentionally omitted
...
...
...
case '2#150':
$value = $this->_getAudioType($value);
break;
case '2#130':
$value = $this->_getImageType($value);
break;
default:
$value = utf8_encode($value);
}
$parsedData[$this->_allowedTags[$key]] = $value;
}
}

Some photos already uploaded (and intialized) won't retreive the title because it would already have been set to "". Those photos need to be reuploaded, or the file folderdata.xml need to be modified for each folder by deleting the following lines for the photos concerned :
<file name="xxxxxx.jpg" custom="" title="" description=""></file>

Posted: 25 May 2010, 00:23
by Nick
Hmm what are you using for editing IPTC? I'd insist on UTF8 fields, just for the sake of a better world.

Actually when testing them myself I found out that not everybody is on UTF8 yet, don't remember exactly right now, but I think atleast Lightroom and Aperture save data in UTF8.

We're trying to remove codepage conversions from Imagevue actually. Just removed codepage for ID3 tags and now IPTC codepages :[

And thank you for clearing it up abit with IPTC titles, I think for now we'll just use auto-fill from 2 fields without manual selection. The problem is there are too many options already, it's not hard to add features, the hardest part is to keep Imagevue within a certain size/complexity limit.

Posted: 25 May 2010, 04:15
by el_professor
I'm not at all an iptc and/or codeset expert, and i think codeset is really a mess on IPTC, as many people/sofware usually assume it's ASCII.

I'm using lightroom 2. I'm not sure of the charset used, i haven't found a software to read the 1x#090 field, but i know it uses MacRoman encoding on Mac OSX.

Many softare i'm using (i' mwilling to replace them with imagevuex2 :wink: ), like Gallery2 (Menalto), Picsengine ...) are using the ObjectName field to store the title.

Posted: 26 May 2010, 02:47
by Nick
The thing is, as long as you use plain Latin (say English) you have no problems, but when it comes to national chars.. everything gets progressively worse. And UTF8 is the answer. Also gotta say that UTF8 and ASCII are exactly same when only Latin letters involved.

Is there characted encoding setting in Lightroom?

Posted: 15 Jun 2010, 09:15
by el_professor
Sorry to answer so late (i was abroad). I'm not sure LR2 use encoding setting. I haven't a sofware that read the iptc 1x#090 field.
(i've read somewhere that LR3 is encoding in utf8).

Posted: 13 Jul 2010, 04:40
by brunods
Hello,

I've a problem with new albums since 2.1.7 version!

Image

Why I have this message?

Thx.
Bruno

Posted: 19 Jul 2010, 14:12
by Nick
Looks like you have broken IPTC data in file:

http://php.net/manual/en/function.unpack.php

Re: IPTC

Posted: 30 Sep 2010, 16:56
by Alandizo
Hey everybody,

I'd like to join the discussion here since you guys might be able to help me out. I'm having issues with international characters, too. Specifically, German ones.

So, this is the setup I use:

In Lightroom 3.2, using IPTC fields "heading" and "caption/abstract" (info taken from the Firefox Extension Exif- Viewer since Lightroom only gives me the German names), I "publish" my gallery photos to a hard drive, that is actually a Webdav-Resource on my webserver. I set this up so Lightroom can publish exactly into the content-folder of my imagevue-installation. Works like a charm. I only have to manually initiate the thumbnail creation but I can live with that. Becauses: Imagevue recognizes the two IPTC fields "heading" and "caption/abstract" and displays them above the photos in the gallery. Awesome.

Only problem with that: If either the filenames (since the published photos get the IPTC title as part of the filename) contain strange characters like ß or ä, something goes wrong. The imagevue-gallery no longer displays the IPTC "heading" as title of the photo and ignores the "caption/abstract". I guess everything is setup to use UTF-8. But I'm not sure. I can't find info on LR 3.2 and where can I check the encoding of everything anyway? Where might be the problem? The Lightroom publish function? The Webdav thing? My webserver? Has imagevue an extra setting somewhere that I didn't find where I can set it up to use UTF8?

Here's my gallery btw: http://fotos.zoerner-web.de/
(If you go to the first menu entry "Stadt", the first photo in there works great, has no special characters, but the eleventh photo with graffiti on the street shows the issue).

Any help or hints where to look at greatly appreciated!
Keep up the good work!
Still love my imagevue gallery despite all the flickr, smugmug and whathaveyou out there!

Kind regards
Alex