3 ms·
> The keen-eyed among you may notice that although, it had a .pdf extension in assetutil info, I’ve given it here as a PNG. I was confused by this too, but upon
by grishka 4y ago
> The keen-eyed among you may notice that although, it had a .pdf extension in assetutil info, I’ve given it here as a PNG. I was confused by this too, but upon closer inspection I believe the PNG is what ships with the OS. Although the .car format is not documented, you can still open it up in a hex viewer and learn a bit about what it contains. Looking through it, there appears to be some metadata for each file, followed by the image data itself.
I reverse engineered the asset catalog format for a bit recently, hoping to be able to unpack and repack existing ones to create system appearances (themes/skins — these also come as .car files, and you can load one as an NSAppearance object and then apply it to your app/window/view).
If it says it's a PDF, then it must be an actual PDF as a "raw data" rendition. I did successfully extract some with nothing but my own code. But, there are no PNGs present in .car files; as of Monterey, bitmap images use a proprietary undocumented compression format called "deepmap2". I wasn't able to exactly reconstruct how it works because my skills of native code reverse engineering are lacking (or am I not using Ghidra correctly to get at least somewhat sensible code out of it?), but I did find the related functions in the vImage framework inside Accelerate.framework.
- shadowfacts 4y agoYou're right: I believe it's using the "Preserve Vector Data" option Xcode shows in the asset catalog editor and the PNG is just what's being rendered by the CoreUI framework.