[ Mini Kiebo ]
Server: Windows NT DESKTOP-5B8S0D4 6.2 build 9200 (Windows 8 Professional Edition) i586
Path:
D:
/
Backup
/
05122024
/
htdocs
/
siakad
/
kerjasama
/
html
/
dashboards
/
[
Home
]
File: proses.php
<?php function crop($width,$height,$quality,$dir,$post,$new_name,$x,$y,$w,$h) { $targ_w = $width; $targ_h = $height; $jpeg_quality = $quality; $src = $_POST[''.$post.'']; $img_r = imagecreatefromjpeg($src); $dst_r = ImageCreateTrueColor( $targ_w, $targ_h ); $info=pathinfo($src); $name=$new_name.".$info[extension]"; $new=$dir.$name; imagecopyresampled($dst_r,$img_r,0,0,$x,$y, $targ_w,$targ_h,$w,$h); imagejpeg($dst_r,$new,$jpeg_quality); } if(isset($_POST['crop'])){ $exp = explode(".",$_GET["img"]); $img = $exp[0]; $width=200; $height=200; $quality=100; $post='source'; $dir="mediamanager/"; $info=pathinfo($dir.$_POST['source']); $new_name='crop_'.$img; $x=$_POST['x']; $y=$_POST['y']; $w=$_POST['w']; $h=$_POST['h']; crop($width,$height,$quality,$dir,$post,$new_name,$x,$y,$w,$h); // echo'<img src="'.$dir.$new_name.".$info[extension]".'"/>'; echo "<script>window.close();</script>"; } if(isset($_POST['crop2'])){ echo "<script>window.close();</script>"; } ?>