Restore Xcode compression using pngcrush on windows?

I have some PNG images extracted from IPA files, and I want to return the original PNG, I was informed that pngcush completed the task, so I downloaded it and tried to run the following command:

pngcrush -fix icon.png icon1.png 

But I get the libpng error. I don't know if libpng needs to be loaded, since the error does not mean that I need another version of libpng, it 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 it didn't know the command.

Any ideas on what to do?

+7
source share
4 answers

You may be interested in this C # library I designed to undo what pngcrush does. All existing implementations that I found were either riddled with errors, or too complicated to integrate into my project, so I developed this. It has unit tests, if that makes you feel more secure.

The addition of -iphone to pngcrush was added by Apple and is only available in the pngcrush version of the iOS SDK available with xcrun , as shown below:

 xcrun -sdk iphoneos pngcrush -iphone|-revert-iphone-optimizations ... 
+3
source

This answer: pngcrush: uncrush on linux? explains that -revert-iphone-optimizations present only in the Apple version of pngcrush . But this points to a couple of other options that might work. Linux, not Windows, but since there is a source, you can make it work.

+2
source

Perhaps you can try pngdefry .

Ideal png solution with multiple IDAT tags.

+2
source

This team probably doesn't know. The documentation found on -revert-iphone-optimizations is available on the apple developer page, which refers to pngcrush, which is part of the iOS SDK. Given this, I would suggest that it was hacked into this particular version by an apple and cannot be part of the official pngcrush download. If this is true, you really need to install it and use the included pngcrush, as described in the article.

I am also a little versed in the syntax used in this example. It looks like a long option, and they usually start with two hythens , not one. It might just be a typo, so try --revert-iphone-optimizations .

0
source

All Articles