PNG Manipulation in Ruby
A few years ago, I was working on a project building an internal App Store for a client. The backend was written using Ruby on Rails. I was giving a demo to some other engineers in the company when I noticed that app icons were failing to load. When I started digging into it I noticed that this only happened in Chrome — Safari loaded and displayed the images just fine.
Knowing a bit about the PNG optimizations Xcode performs, I started looking into the images. Sure enough, the root cause was that the images I was extracting from the .ipa
files as part of the build upload process had their channels swapped. Safari, for whatever reason, knew how to reverse the process; Chrome did not (not that I blame it — good on it for refusing to load random files masquerading as PNGs).
I kicked around several potential approaches for fixing the problem. The most foolproof solution was to use Xcode’s...