summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-07-24 22:11:11 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-07-24 22:11:11 +0200
commit6d861d1222d72bacbb7723f9df05548c76cca967 (patch)
tree7f344333faa7b41d2fe17481d126c8a92aa7173d
parent2684e50a0796d39e424969890c16eb97a8838151 (diff)
downloadrpg-6d861d1222d72bacbb7723f9df05548c76cca967.tar.gz
rpg-6d861d1222d72bacbb7723f9df05548c76cca967.tar.bz2
EXIF/IPTC metadata in media popup
darcs-hash:20050724201111-7ad00-81e8de6162b0e0923c08dcc7b8c750cd604c4dfd.gz
-rw-r--r--inc/template.php17
-rw-r--r--lib/exe/media.php1
-rw-r--r--lib/tpl/default/design.css18
3 files changed, 34 insertions, 2 deletions
diff --git a/inc/template.php b/inc/template.php
index 3a86930be..90fbe5a32 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -612,15 +612,28 @@ function tpl_mediafilelist(){
ptln('('.$w.'&#215;'.$h.' '.filesize_h($item['size']).')',6);
ptln($del.'<br />',6);
+ ptln('<div class="meta">',6);
ptln('<a href="javascript:mediaSelect(\''.$item['id'].'\')">');
if($w>120){
- print '<img src="'.DOKU_BASE.'lib/exe/fetch.php?w=120&amp;media='.urlencode($item['id']).'" width="120" />';
+ print '<img src="'.DOKU_BASE.'lib/exe/fetch.php?w=120&amp;media='.urlencode($item['id']).'" width="120" class="thumb" />';
}else{
- print '<img src="'.DOKU_BASE.'lib/exe/fetch.php?media='.urlencode($item['id']).'" width="'.$w.'" height="'.$h.'" />';
+ print '<img src="'.DOKU_BASE.'lib/exe/fetch.php?media='.urlencode($item['id']).'" width="'.$w.'" height="'.$h.'" class="thumb" />';
}
print '</a>';
+
+ //read EXIF/IPTC data
+ $meta = new JpegMeta(mediaFN($item['id']));
+ $t = $meta->getField('IPTC.Headline');
+ if($t) print '<b>'.$t.'</b><br />';
+ $t = $meta->getField(array('IPTC.Caption','EXIF.UserComment','EXIF.TIFFImageDescription','EXIF.TIFFUserComment'));
+ if($t) print $t.'<br />';
+
+ $t = $meta->getField(array('IPTC.Keywords','IPTC.Category'));
+ if($t) print '<i>'.$t.'</i><br />';
+
+ ptln('</div>',6);
}else{
ptln ('('.filesize_h($item['size']).')',6);
ptln($del,6);
diff --git a/lib/exe/media.php b/lib/exe/media.php
index e824150f3..14474cb0c 100644
--- a/lib/exe/media.php
+++ b/lib/exe/media.php
@@ -5,6 +5,7 @@
require_once(DOKU_INC.'inc/lang/en/lang.php');
require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php');
require_once(DOKU_INC.'inc/html.php');
+ require_once(DOKU_INC.'inc/JpegMeta.php');
require_once(DOKU_INC.'inc/search.php');
require_once(DOKU_INC.'inc/template.php');
require_once(DOKU_INC.'inc/auth.php');
diff --git a/lib/tpl/default/design.css b/lib/tpl/default/design.css
index 81558b4d2..41a34dd5f 100644
--- a/lib/tpl/default/design.css
+++ b/lib/tpl/default/design.css
@@ -700,3 +700,21 @@ dl.img_tags dt {
dl.img_tags dd {
background-color: #f5f5f5;
}
+
+div.meta {
+ color: #666;
+ font-size: 70%;
+ line-height: 95%;
+}
+
+div.meta img.thumb{
+ float:left;
+ margin-right: 0.1em;
+}
+
+/* -------------- Media Popup ---------------------- */
+
+div.mediaselect-right li, div.uploadform {
+ clear: both;
+}
+