javascript调整图片大小[缩小尺寸]并上传 [英] javascript resize image [reduce size] and upload

查看:97
本文介绍了javascript调整图片大小[缩小尺寸]并上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用javascript或Flash调整图片大小?

Is it possible to resize the image with javascript or Flash ?

我的要求:

用户上传的图片大小为10MB,我想使用Javascript或Flash在客户端上调整图片大小,调整图片大小后,需要将其上传到服务器.

A user uploading a image with 10MB in size,i want to re size the image on client side using Javascript or flash,after resizing the image,it need to be uploaded to the server.

如果可以的话,我可以节省带宽.

If it is possible i can save the bandwidth.

我正在使用uploadify在服务器端上传图像和Codeigniter.

I am using uploadify for upload images and Codeigniter on the Server Side.

还有其他方法可以做到吗?

is there any other methods to do this ?

注意:引用某些库确实很有帮助.

Note : Reference to some Libraries are really helpful.

谢谢.

推荐答案

是的,在Flash Player 10和更高版本中是可能的.

Yes, it is possible in Flash Player 10 and later.

这是一篇古老的博客文章,最早是从Flash Player 10和FileReference.load()函数在2008年问世以来,虽然并没有涵盖所有需要的步骤,但它是一个开始:

This is an old blog post, from when Flash Player 10 and the FileReference.load() function was new, back in 2008, and it doesn't cover all steps needed, but it's a start:

http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

您可能还需要研究如何在ActionScript中调整位图的大小,如何将位图编码为JPEG或PNG(使用

You would probably also need to look into how to resize a bitmap in ActionScript, how to encode the bitmap as JPEG or PNG (using as3corelib) and how to upload the result to the server.

编辑: http://www.plupload.com 似乎有支持用于调整大小.还有 http://resize-before-upload.com/

Edit: http://www.plupload.com seems to have support for resizing. There's also http://resize-before-upload.com/

这篇关于javascript调整图片大小[缩小尺寸]并上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆