归档时,Assets.car比实际Images.xcassets文件夹大6倍

时间:2022-02-23 00:26:07

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.

我们在重新设计期间将XCode项目切换为使用资产目录。我们需要几个大的背景图像,我们将其包含在资产目录中。这些图像最初是JPEG,我们将其重命名为PNG以节省空间。磁盘上的映像大小为19.1MB,但是当我们归档应用程序时,生成的Assets.car文件比它大6倍。我尝试过使用PNG并压缩它们,但尺寸仍然很大。我不确定我还能做什么。

2 个解决方案

#1


6  

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.

事实证明,无论原始格式在归档过程中转换为png是什么图像。我将图像移动到使用图像的旧格式,应用程序大小恢复正常。

#2


0  

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.

在构建项目时,Xcode默认“压缩”PNG文件。因此,如果您的JPEG重命名为.png,它们将被转换为真实的PNG,然后进行压缩。

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

可以禁用此行为。只需在项目构建设置中将“压缩PNG文件”选项更改为“否”。

#1


6  

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.

事实证明,无论原始格式在归档过程中转换为png是什么图像。我将图像移动到使用图像的旧格式,应用程序大小恢复正常。

#2


0  

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.

在构建项目时,Xcode默认“压缩”PNG文件。因此,如果您的JPEG重命名为.png,它们将被转换为真实的PNG,然后进行压缩。

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

可以禁用此行为。只需在项目构建设置中将“压缩PNG文件”选项更改为“否”。