From 47c064b890491843482599003d5dddf23ee89eb2 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sun, 28 Mar 2010 02:57:09 +0000 Subject: [PATCH] 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: http://svn.automattic.com/wordpress/trunk@13857 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index bbe0cbd4f..a2ff679f6 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -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