Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorgeodog
    • CommentTimeFeb 23rd 2006
     
    Is there any chance of getting IPTC support in plogger?

    PHP has code to parse JPEG files for IPTC data, and there is some public domain C code floating around the net as well.

    This was done for Gallery, http://tim.digicol.de/gallery_iptc/ but not maintained. I'm using an old hacked up version of Gallery at the moment.

    Flickr has it, although their implementation isn't perfect.

    I have been using IrFanview to add captions and keywords via IPTC for about 3 years, and it would make Plogger twice as useful if could pick up that data instead of me having to enter it again.

    Thanks,
    Tim
    • CommentAuthorgeodog
    • CommentTimeFeb 25th 2006
     
    If you can't do this feature request, can you point me at where in the code you generate captions? Maybe I can hack something in.

    Thanks,
    Tim
    • CommentAuthorddejong
    • CommentTimeFeb 25th 2006
     
    If you can find a PHP library (like EXIFer) that can read IPTC from images, it wouldn't be hard to implement. Though it wouldn't be seen until the release of Beta 3.

    Cheers,
    Derek
    • CommentAuthorgeodog
    • CommentTimeFeb 26th 2006
     
    This library claims to read and write ITPC from images, and is GPL http://www.ozhiker.com/electronics/pjmt/index.html

    PHP itself has the IPTC Parse function, http://www.php.net/manual/en/function.iptcparse.php

    Sample code from that same page

    <pre>
    View all availiable IPCT Data

    function output_iptc_data( $image_path ) {
    $size = getimagesize ( $image_path, $info);
    if(is_array($info)) {
    $iptc = iptcparse($info["APP13"]);
    foreach (array_keys($iptc) as $s) {
    $c = count ($iptc[$s]);
    for ($i=0; $i <$c; $i++)
    {
    echo $s.' = '.$iptc[$s][$i].'<br>';
    }
    }
    }
    }</pre>
    • CommentAuthorgeodog
    • CommentTimeFeb 26th 2006
     
    And here is the code from Tim's Gallery hack, http://tim.digicol.de/gallery_iptc/AlbumItem.php.txt


    function getIPTC($dir, $name, $tag) {

    $result = array();

    $filename = $dir . "/" . $name . "." . $tag;
    getimagesize($filename, $imgsize);

    if (! is_array($imgsize))
    return $result;

    if (! isset($imgsize[ 'APP13' ]))
    return $result;

    $iptc = iptcparse($imgsize[ 'APP13' ]);

    if (! is_array($iptc))
    return $result;

    $iptcmap = array(
    '1#070' => 'DATESENT',
    '1#080' => 'TIMESENT',
    '2#005' => 'OBJECTNAME',
    '2#007' => 'EDITSTATUS',
    '2#010' => 'URGENCY',
    '2#015' => 'CATEGORY',
    '2#020' => 'SUBCATEGORY',
    '2#022' => 'FIXTURE',
    '2#025' => 'KEYWORD',
    '2#030' => 'RELDATE',
    '2#035' => 'RELTIME',
    '2#040' => 'SPECINSTR',
    '2#055' => 'CREDATE',
    '2#060' => 'CRETIME',
    '2#065' => 'ORGPRG',
    '2#070' => 'PRGVER',
    '2#080' => 'BYLINE',
    '2#085' => 'BYTITLE',
    '2#090' => 'CITY',
    '2#092' => 'SUBLOCATION',
    '2#095' => 'STATE',
    '2#100' => 'COUNTRYCODE',
    '2#101' => 'COUNTRYNAME',
    '2#103' => 'ORGTRANSREF',
    '2#105' => 'HEADLINE',
    '2#110' => 'CREDIT',
    '2#115' => 'SOURCE',
    '2#116' => 'COPYRIGHT',
    '2#118' => 'CONTACT',
    '2#120' => 'CAPTION',
    '2#122' => 'CAPTIONWRITER',
    '2#130' => 'IMAGETYPE',
    '2#131' => 'ORIENTATION',
    '2#135' => 'LANGUAGE',
    '8#010' => 'SUBFILE',
    '2#199' => 'APPRESERVER'
    );

    foreach ($iptc as $pos => $values)
    foreach ($values as $value)
    { if (! isset($iptcmap[ $pos ]))
    continue;

    // strip leading zeros (weird Kodak Scanner software)
    while ($value[ 0 ] == chr(0))
    $value = substr($value, 1);

    // remove binary nulls
    $value = str_replace(chr(0x00), ' ', $value);

    if (trim($value) == '')
    continue;

    if (isset($result[ $iptcmap[ $pos ] ]))
    $result[ $iptcmap[ $pos ] ] .= ' ';
    else
    $result[ $iptcmap[ $pos ] ] = '';

    $result[ $iptcmap[ $pos ] ] .= $value;
    }

    return $result;
    }
    • CommentAuthorddejong
    • CommentTimeFeb 26th 2006
     
    With luck, you'll see it in Beta 3.

    You can check up on progress here (http://dev.plogger.org/ticket/118) but it'll be a while yet. ;)

    Cheers,
    Derek
    • CommentAuthorgeodog
    • CommentTimeFeb 26th 2006
     
    Thank you very much. I appreciate the quick responsiveness. I'm happy to be an early tester when you have something coded -- I can be reached at geodog /at/ cyberdude /dot/ com
  1.  
    Hello everyone :)

    I'm glad to hear that IPTC will be someday in Plogger. It's a good news for the noob that I am.

    So, I've try different combination and finaly figure out that adding the function code from the php manual under the function code for exif doesn't brake everything. But if I click on "show detail" it doesn't work.

    As I said I'm a noob in php. I do know some basic like include but not pretty much more. I suppose that if I can't get it to work is the argument's fault. I tried with the original one : $image and the same as plagger $row but neither made the difference.

    Than I tried from Tim's Gallery hack. The "show detail" worked again but no IPTC info to see.

    I keep searching and doodling with the code ( knowing nothing I feel like a blind in the street ) but if someone could give me a hand, in anyway, it would be really nice !