• Viewing iPhoneOptimized PNGs 不及格的程序员


    Technical Q&A QA1681

    Viewing iPhone-Optimized PNGs

    Q:  When I build my iPhone OS application, Xcode optimizes the PNG files within my application's bundle, meaning that Preview can't display them. How can I view these optimized files?

    A: When I build my iPhone OS application, Xcode optimizes the PNG files within my application's bundle, meaning that Preview can't display them. How can I view these optimized files?

    This optimization is done by the pngcrush tool, which you can find in /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush (assuming you installed the iPhone SDK in the standard place). In iPhone SDK 3.2 and later, the pngcrush tool supports a command line option, -revert-iphone-optimizations, that undoes the optimizations done during the Xcode build process. So, to view an optimized PNG file, you should first undo the optimization and then open it with Preview.

    Listing 1 shows how you can use the pngcrush tool to convert an iPhone-optimized PNG file (Local.png) to a standard PNG file (Local-standard.png).

    Listing 1  Undoing iPhone PNG optimization

    $ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush \ -revert-iphone-optimizations -q Local.png Local-standard.png
     

    批量将优化后的PNG文件转换为正常可预览的PNG文件:

    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -revert-iphone-optimizations -d outdir *.png

  • 相关阅读:
    JSON 之 SuperObject(10): Merge、Clone、ForcePath
    JSON 之 SuperObject(5): Format 与转义字符
    语法基础: 使用不同的数据类型标记数组
    JSON 之 SuperObject(9): TSuperType
    JSON 之 SuperObject(12): TSuperEnumerator、TSuperAvlIterator、ObjectFindFirst...
    JSON 之 SuperObject(7): 可以省略的双引号
    JSON 之 SuperObject(11): TSuperTableString、TSuperAvlEntry
    JSON 之 SuperObject(13): 关于 SO 与 SA 函数
    JSON 之 SuperObject(8): 关于乱码的几种情况 向 Henri Gourvest 大师报告
    安装万能五笔时会自动安装copyso
  • 原文地址:https://www.cnblogs.com/ioriwellings/p/2409265.html
Copyright © 2020-2023  润新知