gd_edit_image_support

Check if the installed version of GD supports particular image type.

Description

gd_edit_image_support( (string) $mime_type ); 

Parameters (1)

0. $mime_type (string)
The mime type.

Usage

  1. if ( !function_exists( 'gd_edit_image_support' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The mime type. 
  5. $mime_type = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = gd_edit_image_support($mime_type); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/deprecated.php  
  1. function gd_edit_image_support($mime_type) { 
  2. _deprecated_function( __FUNCTION__, '3.5.0', 'wp_image_editor_supports()' ); 
  3.  
  4. if ( function_exists('imagetypes') ) { 
  5. switch( $mime_type ) { 
  6. case 'image/jpeg': 
  7. return (imagetypes() & IMG_JPG) != 0; 
  8. case 'image/png': 
  9. return (imagetypes() & IMG_PNG) != 0; 
  10. case 'image/gif': 
  11. return (imagetypes() & IMG_GIF) != 0; 
  12. } else { 
  13. switch( $mime_type ) { 
  14. case 'image/jpeg': 
  15. return function_exists('imagecreatefromjpeg'); 
  16. case 'image/png': 
  17. return function_exists('imagecreatefrompng'); 
  18. case 'image/gif': 
  19. return function_exists('imagecreatefromgif'); 
  20. return false;