节省空间:首次启动时,批量缩小旧iPhone/iPad/iPod的所有@ 2x图像大小 [英] Save space: Batch resize down all @2x images for old iPhones/iPads/iPods on first launch

查看:95
本文介绍了节省空间:首次启动时,批量缩小旧iPhone/iPad/iPod的所有@ 2x图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与此有关的问题: iphone 4-加载图片x旧设备

是我们最终使我们的应用充满了双重内容.也就是说,用户必须将2x大小和1x大小的图像都下载到他的设备上,但最终只能使用其中一个,而另一个则浪费了下载时间,等等.

is that we end up filling our apps with double content. Ie a user has to download both the 2x size and the 1x sized image to his device, but will eventually only use one of them and the other one will be a waste of download time etc.

因此,我认为,在某些情况下,可以只用高分辨率图像(@ 2x)填充您的应用程序,然后在应用程序启动时(在应用程序委托中,在显示窗口之前…)之类的方法,您可以将所有@ 2x图像批量缩小以用于低分辨率的屏幕设备.缩小后,您可以将这些文件保存到设备的文档和/或缓存文件夹中,并删除原始的@ 2x图像.那怎么样,有人做过吗? (我的Google,他们什么也不做)这有什么缺点吗?苹果会在某处打我吗?等等...

So I thought, in some cases it could be okay with just filling your app with the high res images (@2x), and on app launch (in the app delegate, before displaying the window... or something), you could batch scale all @2x images down for low res screen devices. When scaled down, you save those files to the device's documents and/or cache folder, and delete the original @2x images. How about that, did anyone do it already? (My googles, they do nothing) Any downsides to this? Will Apple smack me somewhere for doing this? etc...

推荐答案

您绝对可以批量缩放这些@ 2x图像,并将缩放后的文件保存到documents文件夹中.这样可以节省下载时间,并使用与将所有内容捆绑到您的应用程序中相同的空间,但会增加一些复杂性.我认为删除原始@ 2x图像是不可能的,即使这样做是值得的-也不可能在设备之间移动应用程序和用户数据.最好同时根据分辨率选择正确的数据.而且我认为苹果没有理由为此而sm惜你.

You definitely could batch scale those @2x images and save the scaled files to the documents folder. That would save download time, and use the same amount of space as bundling everything with your application, at the cost of some added complexity. I don't think that deleting the original @2x images is possible, however, or worth it even if it were - there's the possibility of moving apps and user data between devices. It would be the best just to choose the right data based on resolution, once you have them both. And I don't see much reason for Apple to smack you for doing this.

哦,当然,如果您确实有很多数据(数百兆字节),那么制作两个版本的应用程序可能是有道理的(例如,与Rage相似).

Oh, and of course, if you really have a lot of data, in the order of hundreds of megabytes, doing two versions of the app might make sense (in the vein of Rage, for example).

这篇关于节省空间:首次启动时,批量缩小旧iPhone/iPad/iPod的所有@ 2x图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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