Assets.car is 6 times larger than actual Images.xcassets folder when archived

你。 提交于 2019-12-19 03:44:15

问题


We switched our XCode project over to use the Asset Catalog during a redesign. We needed several large background images, which we included in the asset catalog. The images were originally JPEGs that we renamed to PNGs to save space. The size of the images on disk is 19.1MB, but when we archive the app the Assets.car file that is generated is 6 times larger than that. I have tried using PNGs and compressing them, but the size is still huge. I'm not sure what else I can do.


回答1:


It turns out that any image no matter what the original format is converted into a png during the archiving process. I moved the images to the old format of using images and the app size returned to normal.




回答2:


Xcode "compresses" PNG files by default when building project. So if your JPEGs are renamed as .png, they will be converted to real PNGs then compressed.

This behaviour can be disabled. Just change Compress PNG Files option to NO in project build settings.



来源:https://stackoverflow.com/questions/22463935/assets-car-is-6-times-larger-than-actual-images-xcassets-folder-when-archived

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!