Fix thumbnails creation for 8bpp and CMYK images, props DD32, fixes #7039 fixes #8231

git-svn-id: https://develop.svn.wordpress.org/trunk@9727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-11-15 23:16:36 +00:00
parent 647180ee18
commit abdc564e7a

View File

@ -319,13 +319,8 @@ function file_is_displayable_image($path) {
$info = @getimagesize($path);
if ( empty($info) )
$result = false;
elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) )
// only gif, jpeg and png images can reliably be displayed
elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) ) // only gif, jpeg and png images can reliably be displayed
$result = false;
elseif ( $info['channels'] > 0 && $info['channels'] != 3 ) {
// some web browsers can't display cmyk or grayscale jpegs
$result = false;
}
else
$result = true;