Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

automatic iptc reader???


matangi

Recommended Posts

Does anyone has experience with iptc, also see at www.iptc.org

This is the description you can add within a picture by using

photoshop e.g.

I want to read that information automaticaly into the database or

picture description.

 

If you have a hint or workaround -- thanks a lot

 

matangi

visit us for music, games, information, webcams, forum, photos, wetter, ...

the polynesien site from europe

Link to comment
Share on other sites

  • 3 months later...

Solution for photographers with big number of photos.

 

We were looking for a good shop-solution for our photostock and we like to use Oscommerce, but we needed some solution for our big numbers of photos (more than 5000) and also a tool to read iptc-data from the photos.

 

If this topic is interesting to you, please visit

 

http://www.coconutcity.com/shop/

 

We are still testing the functions, so I can't place the source in the moment, but I described the way we solved it.

 

Matangi

 

L?sung f?r Fotografen mit gro?en Mengen an Fotos.

 

Wir haben eine L?sung f?r den Online-Verkauf unserer Fotos gesucht und benutzen Oscommerce. Unser Problem war die gro?en Mengen an Bildern bequem in den Shop zu bekommen. Au?erdem wollten wir die Iptc-daten automatisch ?bernehmen.

 

Bei Interesse, hier unser L?sungsweg.

 

http://www.coconutcity.com/shop/

 

Die ?nderungen am Quellcode haben wir noch nicht dokumentiert, da wir noch am Testen sind.

 

Gruss Matangi

visit us for music, games, information, webcams, forum, photos, wetter, ...

the polynesien site from europe

Link to comment
Share on other sites

Bingo!!!!

 

Try:

http://www.zend.com/manual/function.exif-read-data.php

 

<?php
echo "test1.jpg:<br />\n";
$exif = exif_read_data ('tests/test1.jpg','IFD0');
echo $exif===false ? "No header data found.<br />\n" : "Image contains headers<br />";
$exif = exif_read_data ('tests/test2.jpg',0,true);
echo "test2.jpg:<br />\n";
foreach($exif as $key=>$section) {
   foreach($section as $name=>$val) {
       echo "$key.$name: $val<br />\n";
   }
}?>

 

Could produce:

test1.jpg:

No header data found.

test2.jpg:

FILE.FileName: test2.jpg

FILE.FileDateTime: 1017666176

FILE.FileSize: 1240

FILE.FileType: 2

FILE.SectionsFound: ANY_TAG, IFD0, THUMBNAIL, COMMENT

COMPUTED.html: width="1" height="1"

COMPUTED.Height: 1

COMPUTED.Width: 1

COMPUTED.IsColor: 1

COMPUTED.ByteOrderMotorola: 1

COMPUTED.UserComment: Exif test image.

COMPUTED.UserCommentEncoding: ASCII

COMPUTED.Copyright: Photo © M.Boerger, Edited by M.Boerger.

COMPUTED.Copyright.Photographer: Photo © M.Boerger

COMPUTED.Copyright.Editor: Edited by M.Boerger.

IFD0.Copyright: Photo © M.Boerger

IFD0.UserComment: ASCII

THUMBNAIL.JPEGInterchangeFormat: 134

THUMBNAIL.JPEGInterchangeFormatLength: 523

COMMENT.0: Comment #1.

COMMENT.1: Comment #2.

COMMENT.2: Comment #3end

THUMBNAIL.JPEGInterchangeFormat: 134

THUMBNAIL.Thumbnail.Height: 1

THUMBNAIL.Thumbnail.Height: 1

 

 

Note: This function is only available in PHP 4 compiled using --enable-exif. Its functionality and behaviour has changed in PHP 4.2!

 

From that you would have to read the header to find the approerate entries.....

 

Also Look at another one at:

http://www.phpbuilder.com/mail/php-general/2003082/1151.php

 

Also For PHP 4.3+ try

<?php
$size = getimagesize ("testimg.jpg",&$info);
if (isset ($info["APP13"])) {
   $iptc = iptcparse ($info["APP13"]);
   var_dump ($iptc);
}
?>

 

See: http://us3.php.net/manual/en/function.iptcparse.php

 

 

Good Luck

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...