diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-03 05:26:24 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-03 05:26:24 +0000 |
commit | 98fef66fec24524e308add41e9af1177238981ed (patch) | |
tree | b7bf683dd1add65d5b0f30f180511d07e2300e59 /lib/class/album.class.php | |
parent | 7bd22a36da9ae7ac654874bde0ac7f4327d96beb (diff) | |
download | ampache-98fef66fec24524e308add41e9af1177238981ed.tar.gz ampache-98fef66fec24524e308add41e9af1177238981ed.tar.bz2 ampache-98fef66fec24524e308add41e9af1177238981ed.zip |
fixed some album art issues and an issue with downloads if no catalog pattern
Diffstat (limited to 'lib/class/album.class.php')
-rw-r--r-- | lib/class/album.class.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php index ae96e61e..5c810ca6 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -758,13 +758,16 @@ class Album { // Check for PHP:GD and if we have it make sure this image is of some size if (function_exists('ImageCreateFromString')) { - $im = @ImageCreateFromString($image); - if (@imagesx($im) == 1 || @imagesy($im) == 1 && $im) { + $im = ImageCreateFromString($image); + if (imagesx($im) <= 5 || imagesy($im) <= 5 || !$im) { return false; } } // if we have PHP:GD + elseif (strlen($image) < 5) { + return false; + } - // Default to image/jpg as a guess if there is no passed mime type + // Default to image/jpeg as a guess if there is no passed mime type $mime = $mime ? $mime : 'image/jpeg'; // Push the image into the database @@ -791,8 +794,8 @@ class Album { $mime = Dba::escape($mime); $album = Dba::escape($album); - $sql = "UPDATE `album` SET `thumb`='$data',`thumb_mime`='$mime' " . - "WHERE `album`.`id`='$album'"; + $sql = "UPDATE `album_data` SET `thumb`='$data',`thumb_mime`='$mime' " . + "WHERE `album_data`.`album_id`='$album'"; $db_results = Dba::query($sql); } // save_resized_art |