MicrostockGroup Sponsors


Author Topic: Display IPTC and/or EXIF under photos on my own website?  (Read 2090 times)

0 Members and 1 Guest are viewing this topic.

RacePhoto

« on: October 24, 2010, 09:06 »
0
I finally got around to hacking out a modification to someone else's Javascript, so I can display the make, model, shutter speed, ISO Etc. Which is fun and proof that it can be done. Eventually it's not that difficult when someone knows the names and how to access it. (not that I did that myself!)

Should you be interested, look at page 160 and 161 for naming convention and calls. This is the EXIF standards document in PDF.

http://dl.dropbox.com/u/8755020/exifStandard.pdf

Now the real deal.

Anyone know a way to extract the IPTC data for Description field and Caption (something easy for examples) and have it show under an image, when it displays on my own website. Before I go to all the trouble of finding it for myself, I thought it might just be easier to ask? :D I know it's in there, I just don't know how to access and display it?


« Reply #1 on: October 26, 2010, 04:48 »
0
Code: [Select]
if(isset($info['APP13'])) {
$iptc = iptcparse($info['APP13']);
if (is_array($iptc)) {
$trtxt = ".,;?!&";
// title
$title = $iptc["2#005"][0];
$title = trim(trim($title),$trtxt);
// description
$description = trim($iptc["2#120"][0]);
$description = trim(trim($description),$trtxt);
// keywords
$lb_keywords = $iptc["2#025"];
if (count($lb_keywords) > 0) {
foreach ($lb_keywords as $key => $value) $lb_keywords[$key] = str_replace('"',"",str_replace("'","",trim(trim(strtolower($value)),$trtxt)));
} else {
$lb_keywords[0] = 'No keywords';
};

 :P

RacePhoto

« Reply #2 on: October 26, 2010, 20:06 »
0
I'll try that one later tonight. I'm playing Buzztime trivia at BWW and it's 45c wing night.

THANKS


 

Related Topics

  Subject / Started by Replies Last post
4 Replies
3698 Views
Last post April 05, 2006, 12:38
by Stepunk
14 Replies
9229 Views
Last post February 12, 2010, 12:41
by cascoly
26 Replies
3110 Views
Last post May 04, 2013, 08:08
by cascoly
214 Replies
36116 Views
Last post December 13, 2016, 00:42
by PixelBytes
1 Replies
1211 Views
Last post November 22, 2016, 00:03
by obj owl

Sponsors

Microstock Poll Results