Jump to content

Corte de imagens


Recommended Posts

Antes de mais criei na seção de Javascript mas não sei ao certo se é javascript ou PHP


$dst_image = imagecreatetruecolor($dst_w,$dst_h);
$src_image = imagecreatefromjpeg("img/image.jpg");
imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
imagejpeg($dst_image, "new.jpg");

$('#crop_button').click(function() {
 var top = $('#box').position().top;
 var left = $('#box').position().left;
 var width = $('#box').width();
 var height = $('#box').height();
 $.post('inc/crop.php', {top: top, left: left, width: width, height: height}, function() {
  $('.output').html('<img src="new.jpg">');

O resultado que me está a dar é

x GET [HTTP/1.1 404 Not Found 0ms]

Não encontro o erro do output já que não está a cortar nada.

"If It Ain't Broke, Break it and build something Cooler!" Unknown

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.