aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2009-06-20 19:22:35 +0000
committerCash Costello <cash.costello@gmail.com>2009-06-20 19:22:35 +0000
commit139964bcc7bc8c0fc4fd708d9df265e067049391 (patch)
treeb29324fcc7d8bd8c7e2bdaf1069ae0fbe0bd2691
parent59b9d6b625884f5d47aae02671cfa77011005da2 (diff)
downloadelgg-139964bcc7bc8c0fc4fd708d9df265e067049391.tar.gz
elgg-139964bcc7bc8c0fc4fd708d9df265e067049391.tar.bz2
finished improving thumbnail code and replaced the old image error image
-rw-r--r--graphics/empty_album.pngbin0 -> 1389 bytes
-rw-r--r--graphics/image_error_large.pngbin0 -> 2208 bytes
-rw-r--r--graphics/image_error_small.pngbin0 -> 2351 bytes
-rw-r--r--graphics/image_error_thumb.pngbin0 -> 759 bytes
-rw-r--r--graphics/img_error.jpgbin5864 -> 0 bytes
-rw-r--r--thumbnail.php26
-rw-r--r--views/default/object/album.php6
-rw-r--r--views/default/tidypics/albums.php4
8 files changed, 24 insertions, 12 deletions
diff --git a/graphics/empty_album.png b/graphics/empty_album.png
new file mode 100644
index 000000000..0c041d0a2
--- /dev/null
+++ b/graphics/empty_album.png
Binary files differ
diff --git a/graphics/image_error_large.png b/graphics/image_error_large.png
new file mode 100644
index 000000000..4316f459d
--- /dev/null
+++ b/graphics/image_error_large.png
Binary files differ
diff --git a/graphics/image_error_small.png b/graphics/image_error_small.png
new file mode 100644
index 000000000..2f814fd81
--- /dev/null
+++ b/graphics/image_error_small.png
Binary files differ
diff --git a/graphics/image_error_thumb.png b/graphics/image_error_thumb.png
new file mode 100644
index 000000000..0eeb797dc
--- /dev/null
+++ b/graphics/image_error_thumb.png
Binary files differ
diff --git a/graphics/img_error.jpg b/graphics/img_error.jpg
deleted file mode 100644
index e3aad2aed..000000000
--- a/graphics/img_error.jpg
+++ /dev/null
Binary files differ
diff --git a/thumbnail.php b/thumbnail.php
index 113262960..688d400af 100644
--- a/thumbnail.php
+++ b/thumbnail.php
@@ -16,15 +16,27 @@
if ($size != 'small' && $size != 'thumb') {
$size = 'large';
}
- error_log('size is ' . $size);
+
+ $error_image = '';
+ switch ($size) {
+ case 'thumb':
+ $error_image = "image_error_thumb.png";
+ break;
+ case 'small':
+ $error_image = "image_error_small.png";
+ break;
+ case 'large':
+ $error_image = "image_error_large.png";
+ break;
+ }
// Get file entity
$file = get_entity($file_guid);
if (!$file)
- forward('mod/tidypics/graphics/img_error.jpg');
+ forward('mod/tidypics/graphics/' . $error_image);
if ($file->getSubtype() != "image")
- forward('mod/tidypics/graphics/img_error.jpg');
+ forward('mod/tidypics/graphics/' . $error_image);
// Get filename
if ($size == "thumb") {
@@ -34,10 +46,9 @@
} else {
$thumbfile = $file->largethumb;
}
- error_log('filename is ' . $thumbfile);
if (!$thumbfile)
- forward('mod/tidypics/graphics/img_error.jpg');
+ forward('mod/tidypics/graphics/' . $error_image);
// create Elgg File object
$readfile = new ElggFile();
@@ -47,11 +58,12 @@
// send error image if file could not be read
if (!$contents) {
- forward('mod/tidypics/graphics/img_error.jpg');
+ forward('mod/tidypics/graphics/' . $error_image);
}
// Return the thumbnail and exit
- header("Content-type: image");
+ $mime = $file->mimetype;
+ header("Content-type: $mime");
echo $contents;
exit;
?>
diff --git a/views/default/object/album.php b/views/default/object/album.php
index 1e8ff9dc9..eb26123e2 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -5,7 +5,7 @@
global $CONFIG;
- $file = $vars['entity'];
+ $file = $vars['entity'];
$file_guid = $file->getGUID();
$tags = $file->tags;
$title = $file->title;
@@ -14,7 +14,7 @@
$friendlytime = friendly_time($vars['entity']->time_created);
$mime = $file->mimetype;
- if (get_context() == "search") {
+ if (get_context() == "search") {
if (get_input('search_viewtype') == "gallery") {
//default gallery view for album listing @ /photos/owned/
@@ -23,7 +23,7 @@
if($file->cover)
$album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$file->cover.'&size=small" border="0" class="tidypics_album_cover" alt="thumbnail"/>';
else
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/img_error.jpg" class="tidypics_album_cover" alt="new album">';
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="new album">';
?>
<div class="tidypics_album_gallery_item">
diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php
index ba75760c6..9c75bf024 100644
--- a/views/default/tidypics/albums.php
+++ b/views/default/tidypics/albums.php
@@ -14,9 +14,9 @@
foreach($owner_albums as $album) {
if($album->cover)
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" border="0" class="tidypics_album_cover" alt="' . $album->title . '"/>';
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
else
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/img_error.jpg" border="0" class="tidypics_album_cover" alt="' . $album->title . '">';
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">';
?>
<div class="tidypics_album_widget_single_item">
<div class="tidypics_album_widget_title"><a href="<?php echo $album->getURL();?>"><?php echo $album->title;?></a></div>