wp_stream_image

Definition:
function wp_stream_image($image, $mime_type, $post_id) {}

Parameters

  • $image
  • $mime_type
  • $post_id

Defined filters

  • image_save_pre
    apply_filters('image_save_pre', $image, $post_id)

Source code

function wp_stream_image($image, $mime_type, $post_id) {

	$image = apply_filters('image_save_pre', $image, $post_id);



	switch ( $mime_type ) {

		case 'image/jpeg':

			header('Content-Type: image/jpeg');

			return imagejpeg($image, null, 90);

		case 'image/png':

			header('Content-Type: image/png');

			return imagepng($image);

		case 'image/gif':

			header('Content-Type: image/gif');

			return imagegif($image);

		default:

			return false;

	}

}

4145

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: