移动safari下采样大图像。如何保留? [英] Mobile safari downsamples large images. How to retain?

查看:118
本文介绍了移动safari下采样大图像。如何保留?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML网页,其中包含一个1675像素乘2640像素的图片。我试图在iPad中查看它,显然是移动的safari下载图像。我们想要展示高品质的图片,但safari限制了这一点。



我一直在寻找一个解决方案来保留图片大小。我已经在iPad 3上在移动safari上观看了。人们建议使用其他浏览器,但默认情况下我们正在使用移动safari。



这个限制有没有CSS,JavaScript或其他解决方案?

解决方案

我相信你只是喜欢这个答案,但简短的回答似乎是:你不会得到1: 1大图片。



稍长一点的答案是,苹果有意强制事情这样工作,因为之前的工作方式只是不加载图像



http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html#//apple_ref/doc/uid/TP40006482-SW15rel =nofollow> Apple's Known Resoruces限制



事情是,当图像被解码/解压缩时,它比图像文件化占用了更多的RAM空间。苹果公司声称,具有512MB内存的设备(如您提到的ipad 3)将拒绝500万像素以上的非JPEG图像,这会导致:

  height * width <= 5 * 1024 * 1024 



< Apple会注意他们会进行子采样以允许您查看jpegs:


JPEG的最大解码图像大小为32百万像素,使用子采样。
JPEG图像可以高达32百万像素,由于子采样,这允许JPEG图像解码为具有十六分之一像素的大小。大于2兆像素的JPEG图像被子采样 - 即,解码为减小的大小。 JPEG子采样允许用户查看最新数码相机的图像。


请注意,它指出2百万像素是全尺寸观看JPEG,即2 * 1024 * 1024。因为你的图像大约有400万像素以上,它会在iPad 3上进行子采样。不,没有什么你可以做,没有使用外部程序强制它。



要使用外部程序进行最小的改进,请参阅个人推荐GoodReader的链接: Apple论坛,在MiniSfari中寻求完整的图像分辨率



这里是另一个Stackoverflow类似的问题/答案对:移动Safari中的图片大小限制


I have an HTML page with a 1675px by 2640px image in it. I tried viewing it in an iPad and apparently mobile safari downsamples the images. We wanted to show a high quality image but safari restricts this.

I've been searching for a solution to retain the image size. I've been viewing it in iPad 3 on mobile safari. People are suggesting to use another browser but by default we are using mobile safari.

Are there any CSS, JavaScript or other solution to this restriction?

解决方案

I'm sure you are just going to love this answer, but the short answer appears to be: "you aren't going to get 1:1 large sized images".

The slightly longer answer is that Apple intentionally forces things to work this way because before the way it worked was just to not load the image at all, or crash.

Now, for a fuller answer with citations...

Apple's Known Resoruces Limits

The thing is, when an image is decoded/decompressed it takes up a whole heck of a lot more RAM space than the images filesize. The formula Apple states is that devices with 512mb of RAM, like the ipad 3 you mention, will refuse non-JPEG images above 5 megapixels, which results in:

height * width <= 5 * 1024*1024

For JPEG, Apple notes they will subsample to allow you to view jpegs:

The maximum decoded image size for JPEG is 32 megapixels using subsampling. JPEG images can be up to 32 megapixels due to subsampling, which allows JPEG images to decode to a size that has one sixteenth the number of pixels. JPEG images larger than 2 megapixels are subsampled—that is, decoded to a reduced size. JPEG subsampling allows the user to view images from the latest digital cameras.

Note that it states 2 megapixels is the limit for full-sized viewing of JPEG, which is 2*1024*1024. As your image is roughly a bit over 4 megapixels, it will be subsampled on iPad 3. And no, there really isn't anything you can do to force it without using an external program.

To use an external program for minimal improvement, see this link where a person recommends GoodReader: Apple Forum, Seeking Full Image Resolution in MiniSfari

And here is another Stackoverflow with a similar question/answer pair: Image Size Limitations in Mobile Safari

这篇关于移动safari下采样大图像。如何保留?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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