Advertisements

_crop_image_resource

Definition:
function _crop_image_resource($img, $x, $y, $w, $h) {}

Parameters

  • $img
  • $x
  • $y
  • $w
  • $h

Source code

function _crop_image_resource($img, $x, $y, $w, $h) {

	$dst = wp_imagecreatetruecolor($w, $h);

	if ( is_resource($dst) ) {

		if ( imagecopy($dst, $img, 0, 0, $x, $y, $w, $h) ) {

			imagedestroy($img);

			$img = $dst;

		}

	}

	return $img;

}

4303

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: