summaryrefslogtreecommitdiffstats
path: root/albumart.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-31 06:54:08 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-07-31 06:54:08 +0000
commit5f3a6de6d6e57187f9644c3d3922e3947a6f7676 (patch)
treee6102a957455aa422bb5544fadcd9cce5c315a7c /albumart.php
parentd00c637d49cd12f8adbd56774267c7e90278374c (diff)
downloadampache-5f3a6de6d6e57187f9644c3d3922e3947a6f7676.tar.gz
ampache-5f3a6de6d6e57187f9644c3d3922e3947a6f7676.tar.bz2
ampache-5f3a6de6d6e57187f9644c3d3922e3947a6f7676.zip
added automatic image resizing, defaults to off
Diffstat (limited to 'albumart.php')
-rw-r--r--albumart.php40
1 files changed, 30 insertions, 10 deletions
diff --git a/albumart.php b/albumart.php
index 69fcd122..7e97426a 100644
--- a/albumart.php
+++ b/albumart.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2004 Ampache.org
+ Copyright (c) 2001 - 2005 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -41,19 +41,39 @@ if (isset($r->art)) {
$found = 1;
}
+/* Decide what size this image is */
+switch ($_REQUEST['thumb']) {
+ case '1':
+ $size['height'] = '75';
+ $size['width'] = '75';
+ break;
+ case '2':
+ $size['height'] = '128';
+ $size['width'] = '128';
+ break;
+ default:
+ $size['height'] = '275';
+ $size['width'] = '275';
+ break;
+}
+
if (!$found) {
- // Print a transparent gif instead
-// header('Content-type: image/jpg');
-// readfile(conf('prefix') . "/docs/images/blankalbum.jpg");
+ // Print a transparent gif instead
header('Content-type: image/gif');
readfile(conf('prefix') . conf('theme_path') . "/images/blankalbum.gif");
}
else {
- // Print the album art
- $extension = substr($mime,strlen($mime)-3,3);
- header("Content-type: $mime");
- header("Content-Disposition: filename=" . $album->name . "." . $extension);
- echo $art;
-}
+ // Print the album art
+ $extension = substr($mime,strlen($mime)-3,3);
+ header("Content-type: $mime");
+ header("Content-Disposition: filename=" . $album->name . "." . $extension);
+
+ if (!$_REQUEST['thumb']) {
+ echo $art;
+ }
+ elseif (!img_resize($art,$size,$extension)) {
+ echo $art;
+ }
+}
?>