Support » Requests and Feedback » Request for monochrom JPEG image handling

  • WordPress does not handle monochrome JPEG image correctory. This restriction is described in “file_is_displayable_image() function at /wp-admin/includes/image.php”.

    WordPress will not create meta data information for monochrom JPEG images.
    This behavior brings some serious troubles in ‘[gallery]‘ shortcode thumbnails.

    Most of modern WEB browsers can display monochrom JPEG images, please remove this restriction.


    // is the file an image suitable for displaying within a web page?
    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
    		$result = false;
    	elseif ( $info['channels'] > 0 && <strong><em>$info['channels'] != 3</em></strong> ) {
    		// some web browsers can't display cmyk or grayscale jpegs
    		$result = false;
    		$result = true;
    	return apply_filters('file_is_displayable_image', $result, $path);

  • The topic ‘Request for monochrom JPEG image handling’ is closed to new replies.