Welcome Guest, Not a member yet? Register   Sign In
Change y_axis cropping from top to bottom
#1

[eluser]Wonder Woman[/eluser]
Anyone know how to crop an image with y_axis from the bottom instead of the top? Thanks
#2

[eluser]Cristian Gilè[/eluser]
You can override the crop function in your image library:
Code:
<?php
$new_width = 80;
$new_height = 40;
$x_axis = 20;
$y_axis = 13;
// Create image instances
$src = imagecreatefromgif('path/to/your/image');
$dest = imagecreatetruecolor($new_width, $new_height);

// Copy
imagecopy($dest, $src, 0, 0, $x_axis, $y_axis, $new_width, $new_height);

// Output and free from memory
header('Content-Type: image/gif');
imagegif($dest);

imagedestroy($dest);
imagedestroy($src);
?>

http://php.net/manual/en/function.imagecopy.php


Cristian Gilè




Theme © iAndrew 2016 - Forum software by © MyBB