pngcrush:在 Linux 上 uncrush 吗?

发布于 2024-12-01 01:40:48 字数 1539 浏览 4 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不语却知心 2024-12-08 01:40:48

iphone-fixpng 适用于 Linux。请参阅此讨论解释它的作用。我链接到 web.archive.org 因为原始版本已关闭。

iphone-fixpng works in Linux. See this discussion explaining what it does. I'm linking to web.archive.org because the original is down.

北城挽邺 2024-12-08 01:40:48

您可以选择使用其中之一:

  1. 使用 VirtualBox 在 Linux 中安装 Hackintosh。在其中安装 Xcode,然后执行类似 这个

    $ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir uncrushed -revert-iphone-optimizations -q *.png
    

    这使用苹果修改后的 pngcrush 来撤消其优化。我猜这适用于所有压碎的 png。请参阅以获取更准确的命令xcrun

  2. iPIN.py href="http://www.axelbrz.com.ar/?mod=iphone-png-images-normalizer" rel="nofollow noreferrer">此博客并执行为

    $ python ipin.py
    

    这将解压缩实际目录及其子目录中的所有文件。不用担心调用两次,根据我的经验,不会损坏已经未粉碎的 png。从此处您会发现 ipin.py 不会对所有苹果 png 进行去优化

    <块引用>

    它 (ipin.py) 无法处理多个 IDAT 块,不适用于 Adam7 交错图像,并且无法修复预乘 Alpha。

  3. 使用特定的gnome二进制工具。这需要一些低级步骤:

    $ git 克隆 https://github.com/hadess/fixpng-thumbnailer.git
    $ cd fixpng-thumbnailer
    $ ./autogen.sh
    $ 制作
    $ 须藤进行安装
    

    之后,您就可以使用一个新命令gnome-fixpng-thumbnailer,其工作原理如下

    $ gnome-fixpng-thumbnailer [输入文件] [输出文件]

    请小心使用此命令,因为如果对同一个 png 调用两次,它会损坏 png。

    我这样使用它:

    $ 表示 *.png 格式的文件;做 echo " $file";gnome-fixpng-thumbnailer $file $file;完毕
    

    您会猜到为什么要回显文件名。那是因为这个命令可能会默默地失败(如果失败则没有 $? 且非零),并且您将得到的唯一线索是“ZLib 错误!-3”消息。这是一个快速的解决方案,因为有趣的是,您会发现 ipin.py 确实可以解压这些文件。

阅读本文了解有关 pngdefry 的另一个工具。它提供了有关所有这些东西的宝贵信息 - 甚至它的来源 - 但我自己还没有尝试过。

我希望 pngcrush 吸收这些功能,这样你就可以开箱即用,至少我有发送邮件给 pngcrush 维护者(嗨 Glenn)。

You can choose to use one of this:

  1. Install Hackintosh inside linux, with VirtualBox. install Xcode inside it, then do something like this

    $ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -dir uncrushed -revert-iphone-optimizations -q *.png
    

    This uses a modified pngcrush from apple to undo its optimizations. Guess this will work with all crushed pngs. See this for more accurated command xcrun

  2. Download iPIN.py from this blog and execute as

    $ python ipin.py
    

    This will uncrush all files from actual directory and its subdirectories. Don't worry about call it twice, from my experience does not corrupt already uncrushed pngs. From here you will find that ipin.py does not deoptimize all apple pngs

    It (ipin.py) cannot handle multiple IDAT chunks, does not work with Adam7 interlaced images, and does not fix pre-multiplied alpha.

  3. Use an specific gnome binary tool. This needs a few low level steps:

    $ git clone https://github.com/hadess/fixpng-thumbnailer.git
    $ cd fixpng-thumbnailer
    $ ./autogen.sh
    $ make
    $ sudo make install
    

    After that, you have available a new command gnome-fixpng-thumbnailer which works like this

    $ gnome-fixpng-thumbnailer [INPUT FILE] [OUTPUT FILE]

    Take care with this command, because it corrupts pngs if is called twice on same png.

    I use it this way:

    $ for file in *.png; do echo "   $file";gnome-fixpng-thumbnailer $file $file; done
    

    You will guess why echoed the filename. Thats because this command could fail silently, (no $? with nonzero if fails) and the only clue you will have is a "ZLib error! -3" message. It's a quick solution because funnily enough you will find ipin.py does uncrush those files.

Read this for yet another tool around pngdefry. It provides an invaluable info about all this stuff -even its source- but I haven't tried myself.

My hope is in pngcrush absorbs those functionality so you have it out of the box, at least I have send a mail to pngcrush maintainer (hi Glenn).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文