Merge pull request #1073 from caveman99/patch-1
Corrupt Cover Art prohibits mp3 upload
This commit is contained in:
commit
16bbd51267
1 changed files with 8 additions and 6 deletions
|
@ -394,16 +394,18 @@ class FileDataHelper {
|
|||
$im = @imagecreatefromjpeg($get_cont);
|
||||
}
|
||||
|
||||
if ($size){
|
||||
$im = imagescale($im , $size);
|
||||
}
|
||||
|
||||
if(!$im) {
|
||||
// if one of those bombs, create an error image instead
|
||||
if (!$im) {
|
||||
$im = imagecreatetruecolor(150, 30);
|
||||
$bgc = imagecolorallocate($im, 255, 255, 255);
|
||||
$tc = imagecolorallocate($im, 0, 0, 0);
|
||||
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
|
||||
imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
|
||||
imagestring($im, 1, 5, 5, 'Error loading ' . $converted_filename, $tc);
|
||||
}
|
||||
|
||||
// scale if appropriate
|
||||
if ($size){
|
||||
$im = imagescale($im , $size);
|
||||
}
|
||||
|
||||
$img = $im;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue