summaryrefslogtreecommitdiffstats
path: root/lib/ui.lib.php
diff options
context:
space:
mode:
authorPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-05-03 17:26:21 +0000
committerPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-05-03 17:26:21 +0000
commit4c22b56f896d12181ab2724c64d5dd2f55a236f0 (patch)
tree9a5198ffe5290de857e93d8812c759cef5a80f17 /lib/ui.lib.php
parentfeae94b52b06a6d9be040c6636416f07cae87749 (diff)
downloadampache-4c22b56f896d12181ab2724c64d5dd2f55a236f0.tar.gz
ampache-4c22b56f896d12181ab2724c64d5dd2f55a236f0.tar.bz2
ampache-4c22b56f896d12181ab2724c64d5dd2f55a236f0.zip
Remove unused img_resize function, cosmetic changes around the altered version
of it in art.class.php.
Diffstat (limited to 'lib/ui.lib.php')
-rw-r--r--lib/ui.lib.php88
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 2d4f444f..4e761997 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -192,94 +192,6 @@ function show_footer() {
} // show_footer
/**
- * img_resize
- * this automaticly resizes the image for thumbnail viewing
- * only works on gif/jpg/png this function also checks to make
- * sure php-gd is enabled
- */
-function img_resize($image,$size,$type,$album_id) {
-
- /* Make sure they even want us to resize it */
- if (!Config::get('resize_images')) {
- return $image['raw'];
- }
- // Already resized
- if ($image['db_resized']) {
- debug_event('using_resized','using resized image for Album:' . $album_id,'2');
- return $image['raw'];
- }
-
- $image = $image['raw'];
-
- if (!function_exists('gd_info')) { return false; }
-
- /* First check for php-gd */
- $info = gd_info();
-
- if ( ($type == 'jpg' OR $type == 'jpeg') AND !$info['JPG Support']) {
- return false;
- }
- elseif ($type == 'png' AND !$info['PNG Support']) {
- return false;
- }
- elseif ($type == 'gif' AND !$info['GIF Create Support']) {
- return false;
- }
-
- $src = imagecreatefromstring($image);
-
- if (!$src) {
- debug_event('IMG_RESIZE','Failed to create from string','3');
- return false;
- }
-
- $width = imagesx($src);
- $height = imagesy($src);
-
- $new_w = $size['width'];
- $new_h = $size['height'];
-
- $img = imagecreatetruecolor($new_w,$new_h);
-
- if (!imagecopyresampled($img,$src,0,0,0,0,$new_w,$new_h,$width,$height)) {
- debug_event('IMG_RESIZE','Failed to copy resample image','3');
- return false;
- }
-
- ob_start();
-
- // determine image type and send it to the client
- switch ($type) {
- case 'jpg':
- case 'jpeg':
- imagejpeg($img,null,75);
- break;
- case 'gif':
- imagegif($img);
- break;
- case 'png':
- imagepng($img);
- break;
- }
-
- // Grab this image data and save it into the thumbnail
- $data = ob_get_contents();
- ob_end_clean();
-
- // If our image create failed don't save it, just return
- if (!$data) {
- debug_event('IMG_RESIZE','Failed to resize Art from Album:' . $album_id,'3');
- return $image;
- }
-
- // Save what we've got
- Album::save_resized_art($data,'image/' . $type,$album_id);
-
- return $data;
-
-} // img_resize
-
-/**
* get_location
* This function gets the information about said persons currently location
* this is used for A) Sidebar highlighting & submenu showing and B) Titlebar information