![]() ![]() Webptools is a Webp image conversion package for the python.Ĭonvert JPG,PNG. add_argument ( " -v ", " -version ", action = " version ", 100 version = " %(prog)s '. add_argument ( " -delete ", dest = " delete ", action = " store_true ", 98 help = " delete the original image files " ) 99 parser. add_argument ( " -exif ", dest = " exif ", action = " store_true ", 96 help = " preserve the EXIF data from jpeg files " ) 97 parser. processed/ ' if none is " 94 " provided " ) 95 parser. add_argument ( " -d ", " -dst ", dest = " dst ", default = dest_dir, 93 help = " the destination path. Current dir if none is provided " ) 92 parser. add_argument ( " -s ", " -src ", dest = " src ", default = cur_dir, help = " the " 91 " source path. png images for the web """ 88 89 parser = ArgumentParser ( description = main_desc ) 90 parser. ![]() join ( cur_dir, " processed " ) 87 main_desc = """ Optimize. exit ( - 2 ) 81 82 83 def arguments ( ) : 84 """ Defines the command line arguments for the script. join ( ), " You need to install it ", " Stopping. 60 # 61 #= 62 63 _author_ = " joe di castro - " 64 _license_ = " GNU General Public License version 2 " 65 _date_ = " " 66 _version_ = " 0.7 " 67 68 try : 69 import os 70 import glob 71 import platform 72 import re 73 import sys 74 from argparse import ArgumentParser 75 from subprocess import Popen, PIPE, call 76 except ImportError : 77 # Checks the installation of the necessary python modules 78 print ( ( os. 57 # 58 # You should have received a copy of the GNU General Public License 59 # along with this program. See the 56 # GNU General Public License for more details. 52 # 53 # This program is distributed in the hope that it will be useful, 54 # but WITHOUT ANY WARRANTY without even the implied warranty of 55 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 43 #= 44 45 #= 46 # Copyright 2009 joe di castro 47 # 48 # This program is free software: you can redistribute it and/or modify 49 # it under the terms of the GNU General Public License as published by 50 # the Free Software Foundation, either version 3 of the License, or 51 # (at your option) any later version. Also you can specify the source & destination 42 # directories of the images. Store the processed images 40 # in a new subdirectory named 'processed' (I know, I didn't killed myself 41 # worrying about the name). png images in the working directory (where 39 # script runs) and process all of them one by one. 13 # 14 # 15 # Uses the program pngcrush, the command jpegtran of the libjpeg library and 16 # the program gifsicle 17 # 18 # pngcrush, 19 # libjpg, 20 # gifsicle, 21 # 22 # In linux they are usually available in the most popular distribution 23 # repositories, e.g.: 24 # In debian, Ubuntu as these packages: 25 # pngcrush 26 # libjpeg-progs 27 # gifsicle 28 # 29 # In Windows pngcrush can be downloaded at 30 # 31 # libjpeg can be downloaded (as gnuwin32) at 32 # 33 # and gifsicle can be downloaded at 34 # 35 # 36 # How it runs? 37 # 38 # By default get a list of. 10 # 11 # This follows the "Yahoo Best Practices for Speeding Up Your Web Site" about 12 # optimize images. png images for the web 6 """ 7 8 #= 9 # This Script optimizes. Possible License(s): GPL-3.0 1 #!/usr/bin/env python 2 # -*- coding: -*- 3 4 """ 5 img4web.py: optimize. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |