Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert XCode compression with pngcrush on windows?

I have some png images extracted from IPA files and I want to get the original PNG back, I was advised that pngcush did the task required so I downloaded it and tried running the following command:

pngcrush -fix icon.png icon1.png

But I get a libpng error. I don't know if libpng needs to be downloaded as well, since the error doesn't says that I need a different version of libpng, just says:

While reading icon.png:
  pngcrush caught libpng error:
   incorrect header check

I also tried this one:

pngcrush -revert-iphone-optimizations icon.png icn1.png

And pngcrush acts as if didn't knew the command.

Any ideas on what to do?

like image 845
David Conde Avatar asked Apr 02 '12 01:04

David Conde


1 Answers

You may be interested in this C# library I developed to reverse what pngcrush does. All existing implementations I found were either riddled with bugs or too difficult to integrate into my project so I developed this. It has unit tests if that makes you feel safer.

The -iphone addition to pngcrush was added by Apple and is only available in the version of pngcrush in the iOS SDK, accessible by using xcrun like follows:

xcrun -sdk iphoneos pngcrush -iphone|-revert-iphone-optimizations ...
like image 186
Mike Weller Avatar answered Oct 13 '22 12:10

Mike Weller