Prepare
- 自行安装python环境
- pip install tinify(https://github.com/tinify/tinify-python)
- https://tinypng.com/developers 去官网注册账户拿到自己的api_key
Use
-
将工程中的3个Python文件copy到UI设计师给的hdpi,xhdpi,xxhdpi,xxxhdpi的同级目录下(可以是一套图,也可以是多套图,请保持多套图中的同一文件命名相同,谢谢)。
-
根据提示依次运行,python list.py 之后在name.txt里面进行翻译图片名字之后运行python cname.py进行更名之后运行python tinypng.py对图片进行压缩处理。ok,在命令行中我写了大量提示,可以参照提示进行步骤。
-
我在我的mac上运行正常,但是一定还存在很多兼容问题 ~ 欢迎issus & star
Copyright 2017 smallstrong0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.