图片上传以及jCrop和codeigniter
我正在尝试构建一个系统,允许用户从自己的计算机中选择图像,并使用 jQuery 的 jCrop 工具对其进行裁剪。我的问题是我可以显示用户从系统中选择的图像而不将其上传到系统吗?我真的不想进行两次上传,除非我可以默默地进行第一次上传?任何帮助都会很棒。
谢谢。
I am trying to build a system that allows a user to select an image from their own computer, and crop it using the jCrop tool from jQuery. My question is can I show the image the user has selected from their system without uploading it to a system, I dont really want to do two uploads, unless I can do the first upload silently? Any help would be great.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不必上传两次。只需第一次上传图像
使用jCrop并发送图像缩略图的坐标(x,y),宽度和高度。
根据它们调整图像大小
You don't have to upload twice. Just upload the image at first time
Use jCrop and send image Thumbnail's coordinates(x,y), width and height.
Resize Image according to them
AFAIK,目前不使用 JavaScript 和 HTML (4)。
Flash 可以在上传前进行图像处理 - 例如 SWFUpload 可以在上传前调整图像大小(但不支持裁剪) ),但我不知道 Flash 中裁剪工具的开源实现。
使用 HTML 5 也可能是可行的。
但是,我不明白您如何需要两次上传才能做到这一点?不是1.上传2.用Cropper显示3.将Crop信息发送到处理上传文件的PHP脚本吗?
AFAIK, not using JavaScript and HTML (4) at the moment.
Flash can do image processing before upload - SWFUpload for example can resize images before uploading (doesn't support cropping though), but I don't know an Open Source implementation of a Cropping tool in Flash.
It will probably also be possible using HTML 5.
However, I don't see how you would need two uploads to do this? Isn't it 1. Upload 2. Show with Cropper 3. send Crop info to PHP script that processes the uploaded file?