2

I've encountered a weird problem and have not yet been able to figure out the "why".

I have what I believe are proper PNG files for my app icons. When I get the PNGs from one particular artist I notice that his deliverables as well as when I generate the PNG from his PSD via a "Save As", that when they are dropped into the AppIcon section in the Assets catalog, they appear tiny. But Xcode doesn't flag them as being the incorrect size, and they show up properly on the device.

enter image description here

This is a screenshot. If I do export the PNG from the PSD as "Quick Export as PNG", it will show up as the expected size. I've tinkered with other settings like DPI to see if it makes any difference, but haven't yet isolated what is the actual setting is that is causing this.

Was wondering if anyone has encountered this and knows why this is happening.

Mobile Ben
  • 7,121
  • 1
  • 27
  • 43
  • Another note here. It seems also that "Export As" also will end up with correct settings. I did find that the icons had a PPI of 300. However, this should not make a difference. But I also changed it to 72, and the problem still exists, when the PNG is saved via "Save As". – Mobile Ben Dec 11 '18 at 23:52

1 Answers1

0

So I dumped the PNG header information courtesy of a Python script I got from another SO posting (Python: Extract Metadata from PNG)

Version that works

Metadata:
- Image width: 120 pixels
- Image height: 120 pixels
- Bits/pixel: 32
- Pixel format: RGBA
- Compression rate: 1.7x
- Compression: deflate
- MIME type: image/png
- Endianness: Big endian

Version that shows up small

Metadata:
- Image width: 120 pixels
- Image height: 120 pixels
- Bits/pixel: 24
- Pixel format: RGB
- Compression rate: 1.5x
- Image DPI width: 2835 DPI
- Image DPI height: 2835 DPI
- Compression: deflate
- MIME type: image/png
- Endianness: Big endian

The difference being the Image DPI width/height that exists. It would seem to me that the asset catalog in actuality uses some DPI information.

Mobile Ben
  • 7,121
  • 1
  • 27
  • 43
  • This does appear to be related to the PPI. It's not clear if Xcode is somehow using the metadata which encodes DPI. Another oddity is that the artist re-exported the icons and the Image DPI metadata exists .. but now the images work. I reported this to Apple – Mobile Ben Dec 13 '18 at 08:49