Skip to content

Commit

Permalink
Added: JCrop php server crop file
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmich committed May 20, 2015
1 parent 60d50e4 commit 900481f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions jquery.crop/server/crop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* Jcrop image cropping plugin for jQuery
* Example cropping script
* @copyright 2008-2009 Kelly Hallman
* More info: http://deepliquid.com/content/Jcrop_Implementation_Theory.html
*/


$targ_w = $targ_h = 150;
$jpeg_quality = 90;

$src = $_GET['src'];
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );

imagecopyresampled($dst_r,$img_r,0,0,$_GET['x'],$_GET['y'],
$targ_w,$targ_h,$_GET['w'],$_GET['h']);

header('Content-type: image/jpeg');
imagejpeg($dst_r,null,$jpeg_quality);

exit;


?>

0 comments on commit 900481f

Please sign in to comment.