gpt4 book ai didi

linux - Shell 命令不适用于 TinyPNG 的压缩照片

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:19:04 25 4
gpt4 key购买 nike

大家好,我对 shell 了解不多。我需要压缩一些 PNG 文件,我在 web 上找到了一个 bash shell 脚本. bash shell 通常与 tinyPNG 的 API 一起工作。

当我运行 shell 时出现此错误:

bash: tinypng.sh: command not found...

我试过用这个方法运行它:

tinypng.sh  -d [DIRECTORY]/

我也试过这样做:

bash tinypng.sh  -d [DIRECTORY]/

当我运行时,我只是这个信息:

NAME tinypng - Shrink PNGs using tinypng.com service.

SYNOPSIS tinypng [-dkph] -f FILE

DESCRIPTION Shrink PNGs using tinypng.com service.

On first execution, or if /DIRECTORY/DIRECTORY/.tinypng.apikey is not present, tinypng will ask for an API key.

Obtain your API key from https://tinypng.com/developers, copy and paste it when prompted.

OPTIONS

-f,--file FILE              Select a FILE to be shrinked.
-d,--download DIRECTORY Download all shrinked PNGs to DIRECTORY.
-k,--key API_KEY Use API_KEY, instead of the one stored in /DIRECTORY/DIRECTORY/.tinypng.apikey. -p,--print When -d is being used, the URLs of the shrinked PNGs are not being printed to stdout. Use this option to force printing even when using -d.
Otherwise, this option is set implicitly.
-- FILES Ignore any options to come.
Everything after this option is considered a file.
-h,--help Show this message and exit successfully.
EXAMPLES
Shrink foo.png, bar.png, baz.png and print the result URLs to stdout.
$ tinypng -f foo.png -f bar.png -f baz.png
or
$ tinypng -- foo.png bar.png baz.png
Shrink foo.png, bar.png, baz.png and download the result PNGs to tiny_pngs/ directory
$ tinypng -d tiny_pngs/ -- foo.png bar.png baz.png

Written by Rany Albeg Wein - rany.albeg@gmail.com

最佳答案

tinypng --help 显示您的解决方案:

tinypng -d tiny_pngs/-- foo.jpg bar.png baz.png

这将缩小 foo.jpg、bar.png、baz.png 并将缩小的文件下载到 tiny_pngs/目录。

关于linux - Shell 命令不适用于 TinyPNG 的压缩照片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46368525/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com