Webbrowser Javascript 图像编码和调整大小
我正在使用phonegap 和jquery mobile 创建移动应用程序。通过在设备上显示图像列表,我意识到了巨大的性能问题。原因一定是这些图像具有相当高的分辨率(宽度> 1900 px)。
我正在使用 javascript,想要调整设备相机拍摄的图像的大小并降低其分辨率!
是否可以以这种方式操作图像数据或者是否有任何库可以使用? 如果有可能人们必须阅读和/或做些什么才能进入图像处理问题。
提前致谢!
I'm on my way creating a mobile app using phonegap and jquery mobile. i realized huge performance issues by displaying a list of images on the device. the reason must be that those images have a quite high resolution (> 1900 px in width).
i am using javascript and want to resize and reduce the resolution of an image taken by the device's camera!
is it possible to manipulate the image data in this way or is there any library to use?
if it is possible what one has to read and / or to do to get into the matter of image manipulation.
thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要减少服务器端的图像,否则您将不会获得任何结果。使用服务器端语言(例如 php),您可以克隆图像并减小其移动尺寸。因此基本上您将为移动设备检索移动优化的图像。在客户端操作图像不会节省带宽,并且会花费额外的处理成本。
You need to reduce the images on the server side otherwise you aren't gaining anything. Using a server side language such as php you could clone the image and reduce it's size for mobile. So basically you will be retreiving mobile optimized images for mobile devices. Manipulating images on the client won't save you bandwidth and will cost extra processing.
希望这个链接可以帮助您:http://forums.macrumors.com/showthread.php? t=1178073
您可以拍摄较小的照片,而不是调整图像大小。
May this link could help you: http://forums.macrumors.com/showthread.php?t=1178073
Instead of resizing the image you could take a smaler picture.
我发现了一些非常有用的东西!实际上这是一个用javascript编写的jpeg编码器,它可以降低图像质量但不能缩放图片!
http://www.bytesrom.eu/de/blog/2009/1120a_jpeg_encoder_for_javascript
铜
i found something which could be quite useful! actually this is an jpeg encoder written in javascript which can reduce the image's quality but cant scale the picture!
http://www.bytestrom.eu/de/blog/2009/1120a_jpeg_encoder_for_javascript
cu