We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
参考tinypng官方接口文档:https://tinypng.com/developers/reference/python 可以发现脚本中压缩统一张图片调用了2次接口,由于每个key每个月只能免费压缩500张,因此这种方式每压缩一张图片就浪费了一次机会。
source = tinify.from_file(root + '/' + name) source.to_file(toFullName)
with open(toFullName, 'rb') as source: source_data = source.read() result_data = tinify.from_buffer(source_data).to_buffer()
The text was updated successfully, but these errors were encountered:
好的,我改改,谢谢
Sorry, something went wrong.
No branches or pull requests
参考tinypng官方接口文档:https://tinypng.com/developers/reference/python
可以发现脚本中压缩统一张图片调用了2次接口,由于每个key每个月只能免费压缩500张,因此这种方式每压缩一张图片就浪费了一次机会。
方式一
source = tinify.from_file(root + '/' + name)
source.to_file(toFullName)
方式二
with open(toFullName, 'rb') as source:
source_data = source.read()
result_data = tinify.from_buffer(source_data).to_buffer()
The text was updated successfully, but these errors were encountered: