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
This commit is contained in:
dd32 2010-03-28 02:57:09 +00:00
parent f0088e38eb
commit 47c064b890

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