{"id":4982,"date":"2012-06-01T14:59:50","date_gmt":"2012-06-01T19:59:50","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=4982"},"modified":"2012-06-01T14:59:52","modified_gmt":"2012-06-01T19:59:52","slug":"reverting-apples-pngs","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2012\/06\/01\/reverting-apples-pngs\/","title":{"rendered":"Reverting Apple&rsquo;s &ldquo;PNG&rsquo;s&rdquo;"},"content":{"rendered":"<p><a href=\"http:\/\/www.red-sweater.com\/blog\/2517\/fixing-pngs\">Daniel Jalkut<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.red-sweater.com\/blog\/2517\/fixing-pngs\"><p>Essentially, the authors of this tool figured out the optimizations that Apple were doing, and reversed the steps to convert them back into standard PNG images. The tool relied upon a compiled-in version of the libpng library.<\/p>\n<p>Recently when I went to use this tool again, I noticed that it did not work reliably. It dumped lots of memory errors and complained of &ldquo;extra compressed data&rdquo; in the input files. I then proceeded to spend too many hours trying to fix it, bashing my head against libpng, before my friend Tom Harrington alerted me to an Xcode-bundled tool that can do the job reliably:<\/p>\n<p><tt>iPhoneOS.platform\/Developer\/usr\/bin\/pngcrush<\/tt>\n<\/p><\/blockquote>\n<p><a href=\"http:\/\/www.red-sweater.com\/blog\/2517\/fixing-pngs#comment-271777\">Jens Ayton<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.red-sweater.com\/blog\/2517\/fixing-pngs#comment-271777\"><p>&#8230;a more accurate description of the issue is that they <em>are not PNGs<\/em> despite using a PNG header and similar file structure and purloining the .png extension.<\/p>\n<p>The PNG specification has very specific conformance requirements specifically to avoid incompatible variants popping up, and disguising the iPhone-optimized pictures as PNGs is a downright Microsoftishly destructive thing to do.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Daniel Jalkut: Essentially, the authors of this tool figured out the optimizations that Apple were doing, and reversed the steps to convert them back into standard PNG images. The tool relied upon a compiled-in version of the libpng library. Recently when I went to use this tool again, I noticed that it did not work [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-4982","post","type-post","status-publish","format-standard","hentry","category-technology"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=4982"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4982\/revisions"}],"predecessor-version":[{"id":4984,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/4982\/revisions\/4984"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=4982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=4982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=4982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}