Check if function exists before using it. imageistruecolor() requires PHP 4.3.2, WordPress requires 4.3.0 at this stage. Fixes #12297

git-svn-id: https://develop.svn.wordpress.org/trunk@13857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-03-28 02:57:09 +00:00
parent d3eec153be
commit dfee0416ec
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de
imagecopyresampled( $newimage, $image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
// convert from full colors to index colors, like original PNG.
if ( IMAGETYPE_PNG == $orig_type && !imageistruecolor( $image ) )
if ( IMAGETYPE_PNG == $orig_type && function_exists('imageistruecolor') && !imageistruecolor( $image ) )
imagetruecolortopalette( $newimage, false, imagecolorstotal( $image ) );
// we don't need the original in memory anymore