如何使用jquery ajax和php裁剪图像?

时间:2021-05-05 09:50:51

Hi I am doing an social networking project ,where i have an option to add/edit photos ,When user clicks the button the image will be uploaded to the database and it will be updated...but then when user click on the crop button it will open in some popup or modal window and then user crop that image then it will save in database through ajax and php and then display it on his position.

你好,我正在做一个社交网络项目,在这个项目中我有一个添加/编辑照片的选项,当用户点击按钮时,图片将被上传至数据库,并将被更新……但是当用户点击裁剪按钮时它会在弹出窗口或模态窗口中打开然后用户裁剪图片然后通过ajax和php保存到数据库中然后显示在他的位置上。

Is there any jquery plugin like this or need to do custom code.

是否有这样的jquery插件或者需要做自定义代码?

if custom code then what is the best way.

如果自定义代码,那么最好的方法是什么。

8 个解决方案

#1


2  

Try this http://deepliquid.com/content/Jcrop_Download.html

试试这个http://deepliquid.com/content/Jcrop_Download.html

#2


1  

Try my online Photoshop tool built in PHP GD and Javascript.

试试我用PHP GD和Javascript构建的在线Photoshop工具。

http://www.sajithmr.me/photoshop/

http://www.sajithmr.me/photoshop/

Here you can crop, re-size, rotate add watermark image and add watermark text

在这里,您可以裁剪、重新调整大小、旋转添加水印图像和添加水印文本

I also published the full source code in my blog

我还在我的博客上发布了完整的源代码

Hope it helps

希望它能帮助

Thanks

谢谢

Sajith

Sajith

#3


1  

This is the perfect script i found. for this

这是我找到的最完美的脚本。对于这个

UberUploadCropper V2 – Upload, Crop, No Flash

UberUploadCropper V2 -上传,剪切,没有Flash

#4


1  

A wonderful tutorial about crop photo using php and jquery, I made it for 5 months, and it has been used by a lot off applications. http://www.bewebdeveloper.com/tutorial-about-crop-photo-using-php-and-jquery

一个很棒的关于使用php和jquery裁剪照片的教程,我做了5个月,它已经被很多应用程序所使用。http://www.bewebdeveloper.com/tutorial-about-crop-photo-using-php-and-jquery

#5


0  

This might be what you're after...

这可能就是你想要的……

http://www.codeforest.net/how-to-crop-an-image-using-jquery-and-php

http://www.codeforest.net/how-to-crop-an-image-using-jquery-and-php

#6


0  

I've used this tutorial to achieve that goal:

我使用本教程来实现这个目标:

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-jquery-image-cropping-plug-in-from-scratch-part-ii/

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-jquery-image-cropping-plug-in-from-scratch-part-ii/

#7


0  

You could always use the 'jCrop' plugin (just Google jCrop) and use imagik to handle the resize and crop.

您可以始终使用“jCrop”插件(只是谷歌jCrop)并使用imagik来处理大小和裁剪。

jCrop just basically gathers an x and y coordinate and targets the value into a hidden field in a form. So once you post the form you can just use the imagik method cropImage to crop the image using the post values like:

j农作物只是收集了一个x和y坐标,并以一种形式将值定位到一个隐藏的字段中。因此,一旦你发布了表单,你可以使用imagik方法cropImage来裁剪图像,使用post值,比如:

'cropImage($width, $height, $x, $y)'

“cropImage(宽度、高度,美元$ x,y)美元的

Sorry the reply is a bit vague.

抱歉,回复有点含糊。

#8


0  

You can try this plugin either http://odyniec.net/projects/imgareaselect/

你可以试试这个插件:http://odyniec.net/projects/imgareaselect/。

#1


2  

Try this http://deepliquid.com/content/Jcrop_Download.html

试试这个http://deepliquid.com/content/Jcrop_Download.html

#2


1  

Try my online Photoshop tool built in PHP GD and Javascript.

试试我用PHP GD和Javascript构建的在线Photoshop工具。

http://www.sajithmr.me/photoshop/

http://www.sajithmr.me/photoshop/

Here you can crop, re-size, rotate add watermark image and add watermark text

在这里,您可以裁剪、重新调整大小、旋转添加水印图像和添加水印文本

I also published the full source code in my blog

我还在我的博客上发布了完整的源代码

Hope it helps

希望它能帮助

Thanks

谢谢

Sajith

Sajith

#3


1  

This is the perfect script i found. for this

这是我找到的最完美的脚本。对于这个

UberUploadCropper V2 – Upload, Crop, No Flash

UberUploadCropper V2 -上传,剪切,没有Flash

#4


1  

A wonderful tutorial about crop photo using php and jquery, I made it for 5 months, and it has been used by a lot off applications. http://www.bewebdeveloper.com/tutorial-about-crop-photo-using-php-and-jquery

一个很棒的关于使用php和jquery裁剪照片的教程,我做了5个月,它已经被很多应用程序所使用。http://www.bewebdeveloper.com/tutorial-about-crop-photo-using-php-and-jquery

#5


0  

This might be what you're after...

这可能就是你想要的……

http://www.codeforest.net/how-to-crop-an-image-using-jquery-and-php

http://www.codeforest.net/how-to-crop-an-image-using-jquery-and-php

#6


0  

I've used this tutorial to achieve that goal:

我使用本教程来实现这个目标:

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-jquery-image-cropping-plug-in-from-scratch-part-ii/

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-jquery-image-cropping-plug-in-from-scratch-part-ii/

#7


0  

You could always use the 'jCrop' plugin (just Google jCrop) and use imagik to handle the resize and crop.

您可以始终使用“jCrop”插件(只是谷歌jCrop)并使用imagik来处理大小和裁剪。

jCrop just basically gathers an x and y coordinate and targets the value into a hidden field in a form. So once you post the form you can just use the imagik method cropImage to crop the image using the post values like:

j农作物只是收集了一个x和y坐标,并以一种形式将值定位到一个隐藏的字段中。因此,一旦你发布了表单,你可以使用imagik方法cropImage来裁剪图像,使用post值,比如:

'cropImage($width, $height, $x, $y)'

“cropImage(宽度、高度,美元$ x,y)美元的

Sorry the reply is a bit vague.

抱歉,回复有点含糊。

#8


0  

You can try this plugin either http://odyniec.net/projects/imgareaselect/

你可以试试这个插件:http://odyniec.net/projects/imgareaselect/。