PKUN`Gpicopt/__init__.py"""Picopt init and module constants.""" from __future__ import absolute_import, division, print_function __version__ = '1.6.1' PROGRAM_NAME = 'picopt' PKINQ,D D picopt/cli.py#!/usr/bin/env python """Run pictures through image specific external optimizers.""" from __future__ import absolute_import, division, print_function import argparse import multiprocessing import os import sys import time import dateutil.parser from . import PROGRAM_NAME, __version__, walk from .formats import comic, gif, jpeg, png from .settings import Settings # Programs PROGRAMS = set(png.PROGRAMS + gif.PROGRAMS + jpeg.PROGRAMS) FORMAT_DELIMETER = ',' DEFAULT_FORMATS = 'ALL' ALL_DEFAULT_FORMATS = jpeg.FORMATS | gif.FORMATS | \ png.CONVERTABLE_FORMATS ALL_FORMATS = ALL_DEFAULT_FORMATS | comic.FORMATS def get_arguments(args): """Parse the command line.""" usage = "%(prog)s [arguments] [image files]" programs_str = ', '.join([prog.__name__ for prog in PROGRAMS]) description = "Uses "+programs_str+" if they are on the path." parser = argparse.ArgumentParser(usage=usage, description=description) parser.add_argument("-r", "--recurse", action="store_true", dest="recurse", default=0, help="Recurse down through directories ignoring the" "image file arguments on the command line") parser.add_argument("-v", "--verbose", action="count", dest="verbose", default=0, help="Display more output. -v (default) and -vv " "(noisy)") parser.add_argument("-Q", "--quiet", action="store_const", dest="verbose", const=-1, help="Display little to no output") parser.add_argument("-a", "--enable_advpng", action="store_true", dest="advpng", default=0, help="Optimize with advpng (disabled by default)") parser.add_argument("-c", "--comics", action="store_true", dest="comics", default=0, help="Also optimize comic book archives (cbz & cbr)") parser.add_argument("-f", "--formats", action="store", dest="formats", default=DEFAULT_FORMATS, help="Only optimize images of the specifed '{}' " "delimited formats from: {}".format( FORMAT_DELIMETER, ', '.join(sorted(ALL_FORMATS)))) parser.add_argument("-O", "--disable_optipng", action="store_false", dest="optipng", default=1, help="Do not optimize with optipng") parser.add_argument("-P", "--disable_pngout", action="store_false", dest="pngout", default=1, help="Do not optimize with pngout") parser.add_argument("-J", "--disable_jpegrescan", action="store_false", dest="jpegrescan", default=1, help="Do not optimize with jpegrescan") parser.add_argument("-E", "--disable_progressive", action="store_false", dest="jpegtran_prog", default=1, help="Don't try to reduce size by making " "progressive JPEGs with jpegtran") parser.add_argument("-Z", "--disable_mozjpeg", action="store_false", dest="mozjpeg", default=1, help="Do not optimize with mozjpeg") parser.add_argument("-T", "--disable_jpegtran", action="store_false", dest="jpegtran", default=1, help="Do not optimize with jpegtran") parser.add_argument("-G", "--disable_gifsicle", action="store_false", dest="gifsicle", default=1, help="disable optimizing animated GIFs") parser.add_argument("-Y", "--disable_convert_type", action="store_const", dest="to_png_formats", const=png.FORMATS, default=png.CONVERTABLE_FORMATS, help="Do not convert other lossless formats like " " {} to PNG when optimizing. By default, {}" " does convert these formats to PNG".format( ', '.join(png.LOSSLESS_FORMATS), PROGRAM_NAME)) parser.add_argument("-S", "--disable_follow_symlinks", action="store_false", dest="follow_symlinks", default=1, help="disable following symlinks for files and " "directories") parser.add_argument("-b", "--bigger", action="store_true", dest="bigger", default=0, help="Save optimized files that are larger than " "the originals") parser.add_argument("-t", "--record_timestamp", action="store_true", dest="record_timestamp", default=0, help="Store the time of the optimization of full " "directories in directory local dotfiles.") parser.add_argument("-D", "--optimize_after", action="store", dest="optimize_after", default=None, help="only optimize files after the specified " "timestamp. Supercedes -t") parser.add_argument("-N", "--noop", action="store_true", dest="test", default=0, help="Do not replace files with optimized versions") parser.add_argument("-l", "--list", action="store_true", dest="list_only", default=0, help="Only list files that would be optimized") parser.add_argument("-V", "--version", action="version", version=__version__, help="display the version number") parser.add_argument("-M", "--destroy_metadata", action="store_true", dest="destroy_metadata", default=0, help="*Destroy* metadata like EXIF and JFIF") parser.add_argument("paths", metavar="path", type=str, nargs="+", help="File or directory paths to optimize") parser.add_argument("-j", "--jobs", type=int, action="store", dest="jobs", default=multiprocessing.cpu_count(), help="Number of parallel jobs to run simultaneously.") return parser.parse_args(args) def process_arguments(arguments): """Recompute special cases for input arguments.""" Settings.update(arguments) Settings.config_program_reqs(PROGRAMS) Settings.verbose = arguments.verbose + 1 Settings.paths = set(arguments.paths) if arguments.formats == DEFAULT_FORMATS: Settings.formats = arguments.to_png_formats | \ jpeg.FORMATS | gif.FORMATS else: Settings.formats = set( arguments.formats.upper().split(FORMAT_DELIMETER)) if arguments.comics: Settings.formats = Settings.formats | comic.FORMATS if arguments.optimize_after is not None: try: after_dt = dateutil.parser.parse(arguments.optimize_after) arguments.optimize_after = time.mktime(after_dt.timetuple()) except Exception as ex: print(ex) print('Could not parse date to optimize after.') exit(1) if arguments.jobs < 1: Settings.jobs = 1 # Make a rough guess about weather or not to invoke multithreding # jpegrescan '-t' uses three threads # one off multithread switch bcaseu this is the only one right now files_in_paths = 0 non_file_in_paths = False for filename in arguments.paths: if os.path.isfile(filename): files_in_paths += 1 else: non_file_in_paths = True Settings.jpegrescan_multithread = not non_file_in_paths and \ Settings.jobs - (files_in_paths*3) > -1 return arguments def run(args): """Process command line arguments and walk inputs.""" raw_arguments = get_arguments(args[1:]) process_arguments(raw_arguments) walk.run() return True def main(): """Main entry point.""" run(sys.argv) if __name__ == '__main__': main() PKINT. . picopt/detect_format.py"""Detect file formats.""" from __future__ import absolute_import, division, print_function from .formats import comic, gif from .settings import Settings from PIL import Image # Formats NONE_FORMAT = 'NONE' ERROR_FORMAT = 'ERROR' def _is_program_selected(progs): """Determine if the program is enabled in the settings.""" mode = False for prog in progs: if getattr(Settings, prog.__name__): mode = True break return mode def is_format_selected(image_format, formats, progs): """Determine if the image format is selected by command line arguments.""" intersection = formats & Settings.formats mode = _is_program_selected(progs) result = (image_format in intersection) and mode return result def _is_image_sequenced(image): """Determine if the image is a sequenced image.""" try: image.seek(1) image.seek(0) result = True except EOFError: result = False return result def get_image_format(filename): """Get the image format.""" image = None bad_image = 1 image_format = NONE_FORMAT sequenced = False try: bad_image = Image.open(filename).verify() image = Image.open(filename) image_format = image.format sequenced = _is_image_sequenced(image) except (OSError, IOError, AttributeError): pass if sequenced: image_format = gif.SEQUENCED_TEMPLATE.format(image_format) elif image is None or bad_image or image_format == NONE_FORMAT: image_format = ERROR_FORMAT comic_format = comic.get_comic_format(filename) if comic_format: image_format = comic_format if (Settings.verbose > 1) and image_format == ERROR_FORMAT and \ (not Settings.list_only): print(filename, "doesn't look like an image or comic archive.") return image_format def detect_file(filename): """Decide what to do with the file.""" image_format = get_image_format(filename) if image_format in Settings.formats: return image_format if image_format in (NONE_FORMAT, ERROR_FORMAT): return None if Settings.verbose > 1 and not Settings.list_only: print(filename, image_format, 'is not a enabled image or ' 'comic archive type.') return None PKԻUN3Jpicopt/extern.py"""Run external programs.""" from __future__ import absolute_import, division, print_function import subprocess class ExtArgs(object): """Arguments for external programs.""" def __init__(self, old_filename, new_filename): """Set arguments.""" self.old_filename = old_filename self.new_filename = new_filename def does_external_program_run(prog, verbose): """Test to see if the external programs can be run.""" try: with open('/dev/null') as null: subprocess.call([prog, '-h'], stdout=null, stderr=null) result = True except OSError: if verbose > 1: print("couldn't run {}".format(prog)) result = False return result def run_ext(args): """Run EXTERNAL program.""" try: subprocess.check_call(args) except subprocess.CalledProcessError as exc: print(exc) print(exc.cmd) print(exc.returncode) print(exc.output) raise PKxKDxxpicopt/files.py"""File utility operations.""" from __future__ import absolute_import, division, print_function import os from . import PROGRAM_NAME, stats from .settings import Settings REMOVE_EXT = '.{}-remove'.format(PROGRAM_NAME) def replace_ext(filename, new_ext): """Replace the file extention.""" filename_base = os.path.splitext(filename)[0] new_filename = '{}.{}'.format(filename_base, new_ext) return new_filename def _cleanup_after_optimize_aux(filename, new_filename, old_format, new_format): """ Replace old file with better one or discard new wasteful file. """ bytes_in = 0 bytes_out = 0 final_filename = filename try: bytes_in = os.stat(filename).st_size bytes_out = os.stat(new_filename).st_size if (bytes_out > 0) and ((bytes_out < bytes_in) or Settings.bigger): if old_format != new_format: final_filename = replace_ext(filename, new_format.lower()) rem_filename = filename + REMOVE_EXT if not Settings.test: os.rename(filename, rem_filename) os.rename(new_filename, final_filename) os.remove(rem_filename) else: os.remove(new_filename) else: os.remove(new_filename) bytes_out = bytes_in except OSError as ex: print(ex) return final_filename, bytes_in, bytes_out def cleanup_after_optimize(filename, new_filename, old_format, new_format): """ Replace old file with better one or discard new wasteful file. And report results using the stats module. """ final_filename, bytes_in, bytes_out = _cleanup_after_optimize_aux( filename, new_filename, old_format, new_format) return stats.ReportStats(final_filename, bytes_count=(bytes_in, bytes_out)) PKLnJNCDA..picopt/optimize.py"""Optimize a file.""" from __future__ import absolute_import, division, print_function import os import shutil import traceback from . import PROGRAM_NAME, detect_format, files, stats from .extern import ExtArgs from .formats import gif, jpeg, png from .settings import Settings TMP_SUFFIX = '.{}-optimized'.format(PROGRAM_NAME) Settings.formats = png.CONVERTABLE_FORMATS | jpeg.FORMATS | gif.FORMATS Settings.to_png_formats = png.CONVERTABLE_FORMATS def _optimize_image_external(filename, func, image_format, new_ext): """Optimize the file with the external function.""" new_filename = filename + TMP_SUFFIX + new_ext new_filename = os.path.normpath(new_filename) shutil.copy2(filename, new_filename) ext_args = ExtArgs(filename, new_filename) new_image_format = func(ext_args) report_stats = files.cleanup_after_optimize(filename, new_filename, image_format, new_image_format) percent = stats.new_percent_saved(report_stats) if percent != 0: report = '{}: {}'.format(func.__name__, percent) else: report = '' report_stats.report_list.append(report) return report_stats def _optimize_with_progs(format_module, filename, image_format): """ Use the correct optimizing functions in sequence. And report back statistics. """ filesize_in = os.stat(filename).st_size report_stats = None for func in format_module.PROGRAMS: if not getattr(Settings, func.__name__): continue report_stats = _optimize_image_external( filename, func, image_format, format_module.OUT_EXT) filename = report_stats.final_filename if format_module.BEST_ONLY: break if report_stats is not None: report_stats.bytes_in = filesize_in else: report_stats = stats.skip(image_format, filename) return report_stats def _get_format_module(image_format): """Get the format module to use for optimizing the image.""" format_module = None nag_about_gifs = False if detect_format.is_format_selected(image_format, Settings.to_png_formats, png.PROGRAMS): format_module = png elif detect_format.is_format_selected(image_format, jpeg.FORMATS, jpeg.PROGRAMS): format_module = jpeg elif detect_format.is_format_selected(image_format, gif.FORMATS, gif.PROGRAMS): # this captures still GIFs too if not caught above format_module = gif nag_about_gifs = True return format_module, nag_about_gifs def optimize_image(arg): """Optimize a given image from a filename.""" try: filename, image_format, settings = arg Settings.update(settings) format_module, nag_about_gifs = _get_format_module(image_format) if format_module is None: if Settings.verbose > 1: print(filename, image_format) # image.mode) print("\tFile format not selected.") return None report_stats = _optimize_with_progs(format_module, filename, image_format) report_stats.nag_about_gifs = nag_about_gifs stats.report_saved(report_stats) return report_stats except Exception as exc: print(exc) traceback.print_exc(exc) return stats.ReportStats(filename, error="Optimizing Image") PKIN/ǥiipicopt/settings.py"""Settings class for picopt.""" from __future__ import absolute_import, division, print_function import multiprocessing from . import extern class Settings(object): """Global settings class.""" advpng = False archive_name = None bigger = False comics = False destroy_metadata = False follow_symlinks = True formats = set() gifsicle = True ignore = [] jobs = multiprocessing.cpu_count() jpegrescan = True jpegrescan_multithread = False jpegtran = True jpegtran_prog = True list_only = False mozjpeg = True optimize_after = None optipng = True paths = set() pngout = True record_timestamp = False recurse = False test = False to_png_formats = set() verbose = 1 @classmethod def update(cls, settings): """Update settings with a dict.""" for key, val in settings.__dict__.items(): if key.startswith('_'): continue setattr(cls, key, val) @classmethod def _set_program_defaults(cls, programs): """Run the external program tester on the required binaries.""" for program in programs: val = getattr(cls, program.__name__) \ and extern.does_external_program_run(program.__name__, Settings.verbose) setattr(cls, program.__name__, val) @classmethod def config_program_reqs(cls, programs): """Run the program tester and determine if we can do anything.""" cls._set_program_defaults(programs) do_png = cls.optipng or cls.pngout or cls.advpng do_jpeg = cls.mozjpeg or cls.jpegrescan or cls.jpegtran do_comics = cls.comics if not do_png and not do_jpeg and not do_comics: print("All optimizers are not available or disabled.") exit(1) PKLnJNnqpicopt/stats.py"""Statistics for the optimization operations.""" from __future__ import absolute_import, division, print_function import os import sys from .settings import Settings if sys.version > '3': LongInt = int else: LongInt = long ABBREVS = ( (1 << LongInt(50), 'PiB'), (1 << LongInt(40), 'TiB'), (1 << LongInt(30), 'GiB'), (1 << LongInt(20), 'MiB'), (1 << LongInt(10), 'kiB'), (1, 'bytes') ) class ReportStats(object): """Container for reported stats from optimization operations.""" def __init__(self, final_filename, report=None, bytes_count=None, nag_about_gifs=False, error=None): """Initialize required instance variables.""" self.final_filename = final_filename self.report_list = [] self.error = error if report: self.report_list.append(report) if bytes_count: self.bytes_in = bytes_count[0] self.bytes_out = bytes_count[1] else: self.bytes_count = 0 self.bytes_count = 0 self.nag_about_gifs = nag_about_gifs def _humanize_bytes(num_bytes, precision=1): """ Return a humanized string representation of a number of num_bytes. from: http://code.activestate.com/recipes/ 577081-humanized-representation-of-a-number-of-num_bytes/ Assumes `from __future__ import division`. >>> humanize_bytes(1) '1 byte' >>> humanize_bytes(1024) '1.0 kB' >>> humanize_bytes(1024*123) '123.0 kB' >>> humanize_bytes(1024*12342) '12.1 MB' >>> humanize_bytes(1024*12342,2) '12.05 MB' >>> humanize_bytes(1024*1234,2) '1.21 MB' >>> humanize_bytes(1024*1234*1111,2) '1.31 GB' >>> humanize_bytes(1024*1234*1111,1) '1.3 GB' """ if num_bytes == 0: return 'no bytes' if num_bytes == 1: return '1 byte' factored_bytes = 0 factor_suffix = 'bytes' for factor, suffix in ABBREVS: if num_bytes >= factor: factored_bytes = num_bytes / factor factor_suffix = suffix break if factored_bytes == 1: precision = 0 return '{:.{prec}f} {}'.format(factored_bytes, factor_suffix, prec=precision) def new_percent_saved(report_stats): """Spit out how much space the optimization saved.""" size_in = report_stats.bytes_in if size_in > 0: size_out = report_stats.bytes_out ratio = size_out / size_in kb_saved = _humanize_bytes(size_in - size_out) else: ratio = 0 kb_saved = 0 percent_saved = (1 - ratio) * 100 result = '{:.{prec}f}% ({})'.format(percent_saved, kb_saved, prec=2) return result def truncate_cwd(full_filename): """Remove the cwd from the full filename.""" if full_filename.startswith(os.getcwd()): truncated_filename = full_filename.split(os.getcwd(), 1)[1] truncated_filename = truncated_filename.split(os.sep, 1)[1] else: truncated_filename = full_filename return truncated_filename def report_saved(report_stats): """Record the percent saved & print it.""" if Settings.verbose: report = '' truncated_filename = truncate_cwd(report_stats.final_filename) report += '{}: '.format(truncated_filename) total = new_percent_saved(report_stats) if total: report += total else: report += '0%' if Settings.test: report += ' could be saved.' if Settings.verbose > 1: tools_report = ', '.join(report_stats.report_list) if tools_report: report += '\n\t' + tools_report print(report) def report_totals(bytes_in, bytes_out, nag_about_gifs, errors): """Report the total number and percent of bytes saved.""" if bytes_in: bytes_saved = bytes_in - bytes_out percent_bytes_saved = bytes_saved / bytes_in * 100 msg = '' if Settings.test: if percent_bytes_saved > 0: msg += "Could save" elif percent_bytes_saved == 0: msg += "Could even out for" else: msg += "Could lose" else: if percent_bytes_saved > 0: msg += "Saved" elif percent_bytes_saved == 0: msg += "Evened out" else: msg = "Lost" msg += " a total of {} or {:.{prec}f}%".format( _humanize_bytes(bytes_saved), percent_bytes_saved, prec=2) if Settings.verbose: print(msg) if Settings.test: print("Test run did not change any files.") else: if Settings.verbose: print("Didn't optimize any files.") if nag_about_gifs and Settings.verbose: print("Most animated GIFS would be better off converted to" " HTML5 video") if not errors: return print("Errors with the following files:") for error in errors: print("{}: {}".format(error[0], error[1])) def skip(type_name, filename): """Provide reporting statistics for a skipped file.""" report = ['Skipping {} file: {}'.format(type_name, filename)] report_stats = ReportStats(filename, report=report) return report_stats PKIN kpicopt/timestamp.py"""Timestamp writer for keeping track of bulk optimizations.""" from __future__ import absolute_import, division, print_function import os import sys from datetime import datetime from . import PROGRAM_NAME from .settings import Settings RECORD_FILENAME = '.{}_timestamp'.format(PROGRAM_NAME) TIMESTAMP_CACHE = {} OLD_TIMESTAMPS = set() def _get_timestamp(dirname_full, remove): """ Get the timestamp from the timestamp file. Optionally mark it for removal if we're going to write another one. """ record_filename = os.path.join(dirname_full, RECORD_FILENAME) if not os.path.exists(record_filename): return None mtime = os.stat(record_filename).st_mtime mtime_str = datetime.fromtimestamp(mtime) print('Found timestamp {}:{}'.format(dirname_full, mtime_str)) if Settings.record_timestamp and remove: OLD_TIMESTAMPS.add(record_filename) return mtime def _get_timestamp_cached(dirname_full, remove): """ Get the timestamp from the cache or fill the cache Much quicker than reading the same files over and over """ if dirname_full not in TIMESTAMP_CACHE: mtime = _get_timestamp(dirname_full, remove) TIMESTAMP_CACHE[dirname_full] = mtime return TIMESTAMP_CACHE[dirname_full] if sys.version > '3': def max_none(lst): """Max function that works in python 3.""" return max((x for x in lst if x is not None), default=None) else: def max_none(lst): """Max function from python 2.""" return max(lst) def _max_timestamps(dirname_full, remove, compare_tstamp): """Compare a timestamp file to one passed in. Get the max.""" tstamp = _get_timestamp_cached(dirname_full, remove) return max_none((tstamp, compare_tstamp)) def _get_parent_timestamp(dirname, mtime): """ Get the timestamps up the directory tree. All the way to root. Because they affect every subdirectory. """ parent_pathname = os.path.dirname(dirname) # max between the parent timestamp the one passed in mtime = _max_timestamps(parent_pathname, False, mtime) if dirname != os.path.dirname(parent_pathname): # this is only called if we're not at the root mtime = _get_parent_timestamp(parent_pathname, mtime) return mtime def get_walk_after(filename, optimize_after=None): """ Figure out the which mtime to check against. If we have to look up the path return that. """ if Settings.optimize_after is not None: return Settings.optimize_after dirname = os.path.dirname(filename) if optimize_after is None: optimize_after = _get_parent_timestamp(dirname, optimize_after) return _max_timestamps(dirname, True, optimize_after) def record_timestamp(pathname_full): """Record the timestamp of running in a dotfile.""" if Settings.test or Settings.list_only or not Settings.record_timestamp: return if not Settings.follow_symlinks and os.path.islink(pathname_full): if Settings.verbose: print('Not setting timestamp because not following symlinks') return if not os.path.isdir(pathname_full): if Settings.verbose: print('Not setting timestamp for a non-directory') return record_filename_full = os.path.join(pathname_full, RECORD_FILENAME) try: with open(record_filename_full, 'w'): os.utime(record_filename_full, None) if Settings.verbose: print("Set timestamp: {}".format(record_filename_full)) for fname in OLD_TIMESTAMPS: if fname.startswith(pathname_full) and \ fname != record_filename_full: # only remove timestamps below the curent path # but don't remove the timestamp we just set! os.remove(fname) if Settings.verbose: print('Removed old timestamp: {}'.format(fname)) except IOError: print("Could not set timestamp in {}".format(pathname_full)) PKLnJN5,>picopt/walk.py"""Walk the directory trees and files and call the optimizers.""" from __future__ import absolute_import, division, print_function import multiprocessing import os from . import detect_format, optimize, stats, timestamp from .formats import comic from .settings import Settings def _comic_archive_skip(report_stats): return report_stats def walk_comic_archive(filename_full, image_format, optimize_after): """ Optimize a comic archive. This is done mostly inline to use the master processes process pool for workers. And to avoid calling back up into walk from a dedicated module or format processor. It does mean that we block on uncompress and on waiting for the contents subprocesses to compress. """ # uncompress archive tmp_dir, report_stats = comic.comic_archive_uncompress(filename_full, image_format) if tmp_dir is None and report_stats: return Settings.pool.apply_async(_comic_archive_skip, args=report_stats) # optimize contents of archive archive_mtime = os.stat(filename_full).st_mtime result_set = walk_dir(tmp_dir, optimize_after, True, archive_mtime) # wait for archive contents to optimize before recompressing nag_about_gifs = False for result in result_set: res = result.get() nag_about_gifs = nag_about_gifs or res.nag_about_gifs # recompress archive args = (filename_full, image_format, Settings, nag_about_gifs) return Settings.pool.apply_async(comic.comic_archive_compress, args=(args,)) def _is_skippable(filename_full): """Handle things that are not optimizable files.""" # File types if not Settings.follow_symlinks and os.path.islink(filename_full): return True if os.path.basename(filename_full) == timestamp.RECORD_FILENAME: return True if not os.path.exists(filename_full): if Settings.verbose: print(filename_full, 'was not found.') return True return False def _is_older_than_timestamp(filename, walk_after, archive_mtime): if walk_after is None: return False mtime = os.stat(filename).st_mtime # if the file is in an archive, use the archive time if it # is newer. This helps if you have a new archive that you # collected from someone who put really old files in it that # should still be optimised if archive_mtime is not None: mtime = max(mtime, archive_mtime) return mtime <= walk_after def walk_file(filename, walk_after, recurse=None, archive_mtime=None): """Optimize an individual file.""" filename = os.path.normpath(filename) result_set = set() if _is_skippable(filename): return result_set walk_after = timestamp.get_walk_after(filename, walk_after) # File is a directory if os.path.isdir(filename): return walk_dir(filename, walk_after, recurse, archive_mtime) if _is_older_than_timestamp(filename, walk_after, archive_mtime): return result_set # Check image format try: image_format = detect_format.detect_file(filename) except Exception: res = Settings.pool.apply_async(stats.ReportStats, (filename,), {'error': "Detect Format"}) result_set.add(res) image_format = False if not image_format: return result_set if Settings.list_only: # list only print("{}: {}".format(filename, image_format)) return result_set if detect_format.is_format_selected(image_format, comic.FORMATS, comic.PROGRAMS): # comic archive result = walk_comic_archive(filename, image_format, walk_after) else: # regular image args = [filename, image_format, Settings] result = Settings.pool.apply_async(optimize.optimize_image, args=(args,)) result_set.add(result) return result_set def walk_dir(dir_path, walk_after, recurse=None, archive_mtime=None): """Recursively optimize a directory.""" if recurse is None: recurse = Settings.recurse result_set = set() if not recurse: return result_set for root, _, filenames in os.walk(dir_path): for filename in filenames: filename_full = os.path.join(root, filename) try: results = walk_file(filename_full, walk_after, recurse, archive_mtime) result_set = result_set.union(results) except Exception: print("Error with file: {}".format(filename_full)) raise return result_set def _walk_all_files(): """ Optimize the files from the arugments list in two batches. One for absolute paths which are probably outside the current working directory tree and one for relative files. """ # Init records record_dirs = set() result_set = set() for filename in Settings.paths: # Record dirs to put timestamps in later filename_full = os.path.abspath(filename) if Settings.recurse and os.path.isdir(filename_full): record_dirs.add(filename_full) walk_after = timestamp.get_walk_after(filename_full) results = walk_file(filename_full, walk_after, Settings.recurse) result_set = result_set.union(results) bytes_in = 0 bytes_out = 0 nag_about_gifs = False errors = [] for result in result_set: res = result.get() if res.error: errors += [(res.final_filename, res.error)] continue bytes_in += res.bytes_in bytes_out += res.bytes_out nag_about_gifs = nag_about_gifs or res.nag_about_gifs return record_dirs, bytes_in, bytes_out, nag_about_gifs, errors def run(): """Use preconfigured settings to optimize files.""" # Setup Multiprocessing # manager = multiprocessing.Manager() Settings.pool = multiprocessing.Pool(Settings.jobs) # Optimize Files record_dirs, bytes_in, bytes_out, nag_about_gifs, errors = \ _walk_all_files() # Shut down multiprocessing Settings.pool.close() Settings.pool.join() # Write timestamps for filename in record_dirs: timestamp.record_timestamp(filename) # Finish by reporting totals stats.report_totals(bytes_in, bytes_out, nag_about_gifs, errors) PKxKɂtYYpicopt/formats/__init__.py"""Init for formats.""" from __future__ import absolute_import, division, print_function PKIN~=1gpicopt/formats/comic.py"""Optimize comic archives.""" from __future__ import absolute_import, division, print_function import os import shutil import traceback import zipfile import rarfile from .. import PROGRAM_NAME, files, stats from ..settings import Settings from ..stats import ReportStats _CBZ_FORMAT = 'CBZ' _CBR_FORMAT = 'CBR' FORMATS = set((_CBZ_FORMAT, _CBR_FORMAT)) _CBR_EXT = '.cbr' _CBZ_EXT = '.cbz' _COMIC_EXTS = set((_CBR_EXT, _CBZ_EXT)) OUT_EXT = _CBZ_EXT _ARCHIVE_TMP_DIR_PREFIX = PROGRAM_NAME+'_tmp_' _ARCHIVE_TMP_DIR_TEMPLATE = _ARCHIVE_TMP_DIR_PREFIX+'{}' _NEW_ARCHIVE_SUFFIX = '{}-optimized{}'.format(PROGRAM_NAME, OUT_EXT) def comics(): """ Dummy Comic optimizer. Not used because comics are special and use walk.walk_comic_archive But currently neccissary to keep detect_format._is_program_selected() working """ PROGRAMS = (comics,) BEST_ONLY = False def get_comic_format(filename): """Return the comic format if it is a comic archive.""" image_format = None filename_ext = os.path.splitext(filename)[-1].lower() if filename_ext in _COMIC_EXTS: if zipfile.is_zipfile(filename): image_format = _CBZ_FORMAT elif rarfile.is_rarfile(filename): image_format = _CBR_FORMAT return image_format def _get_archive_tmp_dir(filename): """Get the name of the working dir to use for this filename.""" head, tail = os.path.split(filename) return os.path.join(head, _ARCHIVE_TMP_DIR_TEMPLATE.format(tail)) def comic_archive_uncompress(filename, image_format): """ Uncompress comic archives. Return the name of the working directory we uncompressed into. """ if not Settings.comics: report = ['Skipping archive file: {}'.format(filename)] return None, ReportStats(filename, report=report) if Settings.verbose: truncated_filename = stats.truncate_cwd(filename) print("Extracting {}...".format(truncated_filename), end='') # create the tmpdir tmp_dir = _get_archive_tmp_dir(filename) if os.path.isdir(tmp_dir): shutil.rmtree(tmp_dir) os.mkdir(tmp_dir) # extract archvie into the tmpdir if image_format == _CBZ_FORMAT: with zipfile.ZipFile(filename, 'r') as zfile: zfile.extractall(tmp_dir) elif image_format == _CBR_FORMAT: with rarfile.RarFile(filename, 'r') as rfile: rfile.extractall(tmp_dir) else: report = '{} {} is not a good format'.format(filename, image_format) return None, ReportStats(filename, report=report) if Settings.verbose: print('done') return tmp_dir, None def _comic_archive_write_zipfile(new_filename, tmp_dir): """Zip up the files in the tempdir into the new filename.""" if Settings.verbose: print('Rezipping archive', end='') with zipfile.ZipFile(new_filename, 'w', compression=zipfile.ZIP_DEFLATED) as new_zf: root_len = len(os.path.abspath(tmp_dir)) for r_d_f in os.walk(tmp_dir): root = r_d_f[0] filenames = r_d_f[2] archive_root = os.path.abspath(root)[root_len:] for fname in filenames: fullpath = os.path.join(root, fname) archive_name = os.path.join(archive_root, fname) if Settings.verbose: print('.', end='') new_zf.write(fullpath, archive_name, zipfile.ZIP_DEFLATED) def comic_archive_compress(args): """ Called back by every optimization inside a comic archive. When they're all done it creates the new archive and cleans up. """ try: filename, old_format, settings, nag_about_gifs = args Settings.update(settings) tmp_dir = _get_archive_tmp_dir(filename) # archive into new filename new_filename = files.replace_ext(filename, _NEW_ARCHIVE_SUFFIX) _comic_archive_write_zipfile(new_filename, tmp_dir) # Cleanup tmpdir if os.path.isdir(tmp_dir): if Settings.verbose: print('.', end='') shutil.rmtree(tmp_dir) if Settings.verbose: print('done.') report_stats = files.cleanup_after_optimize( filename, new_filename, old_format, _CBZ_FORMAT) report_stats.nag_about_gifs = nag_about_gifs stats.report_saved(report_stats) return report_stats except Exception as exc: print(exc) traceback.print_exc(exc) raise exc PKxKE picopt/formats/gif.py"""Gif format.""" from __future__ import absolute_import, division, print_function from .. import extern SEQUENCED_TEMPLATE = '{} SEQUENCED' _GIF_FORMAT = 'GIF' FORMATS = set([SEQUENCED_TEMPLATE.format(_GIF_FORMAT), _GIF_FORMAT]) OUT_EXT = '.'+_GIF_FORMAT.lower() _GIFSICLE_ARGS = ['gifsicle', '--optimize=3', '--batch'] def gifsicle(ext_args): """Run the EXTERNAL program gifsicle.""" args = _GIFSICLE_ARGS + [ext_args.new_filename] extern.run_ext(args) return _GIF_FORMAT PROGRAMS = (gifsicle,) BEST_ONLY = True PKxKqpicopt/formats/jpeg.py"""JPEG format.""" from __future__ import absolute_import, division, print_function import copy from .. import extern from ..settings import Settings _JPEG_FORMAT = 'JPEG' FORMATS = set([_JPEG_FORMAT]) OUT_EXT = '.jpg' _MOZJPEG_ARGS = ['mozjpeg'] _JPEGTRAN_ARGS = ['jpegtran', '-optimize'] _JPEGRESCAN_ARGS = ['jpegrescan'] def mozjpeg(ext_args): """Create argument list for mozjpeg.""" args = copy.copy(_MOZJPEG_ARGS) if Settings.destroy_metadata: args += ["-copy", "none"] else: args += ["-copy", "all"] args += ['-outfile'] args += [ext_args.new_filename, ext_args.old_filename] extern.run_ext(args) return _JPEG_FORMAT def jpegtran(ext_args): """Create argument list for jpegtran.""" args = copy.copy(_JPEGTRAN_ARGS) if Settings.destroy_metadata: args += ["-copy", "none"] else: args += ["-copy", "all"] if Settings.jpegtran_prog: args += ["-progressive"] args += ['-outfile'] args += [ext_args.new_filename, ext_args.old_filename] extern.run_ext(args) return _JPEG_FORMAT def jpegrescan(ext_args): """Run the EXTERNAL program jpegrescan.""" args = copy.copy(_JPEGRESCAN_ARGS) if Settings.jpegrescan_multithread: args += ['-t'] if Settings.destroy_metadata: args += ['-s'] args += [ext_args.old_filename, ext_args.new_filename] extern.run_ext(args) return _JPEG_FORMAT PROGRAMS = (mozjpeg, jpegrescan, jpegtran) BEST_ONLY = True PKINA33picopt/formats/png.py"""PNG format.""" from __future__ import absolute_import, division, print_function from .. import extern _PNG_FORMAT = 'PNG' FORMATS = set([_PNG_FORMAT]) LOSSLESS_FORMATS = set(('PNM', 'PPM', 'BMP', 'GIF')) CONVERTABLE_FORMATS = LOSSLESS_FORMATS | FORMATS OUT_EXT = '.'+_PNG_FORMAT.lower() _OPTIPNG_ARGS = ['optipng', '-o6', '-fix', '-preserve', '-force', '-quiet'] _ADVPNG_ARGS = ['advpng', '-z', '-4', '-f'] _PNGOUT_ARGS = ['pngout', '-q', '-force', '-y'] def optipng(ext_args): """Run the external program optipng on the file.""" args = _OPTIPNG_ARGS + [ext_args.new_filename] extern.run_ext(args) return _PNG_FORMAT def advpng(ext_args): """Run the external program advpng on the file.""" args = _ADVPNG_ARGS + [ext_args.new_filename] extern.run_ext(args) return _PNG_FORMAT def pngout(ext_args): """Run the external program pngout on the file.""" args = _PNGOUT_ARGS + [ext_args.old_filename, ext_args.new_filename] extern.run_ext(args) return _PNG_FORMAT PROGRAMS = (optipng, advpng, pngout) BEST_ONLY = False PK!Hp'*'picopt-1.6.1.dist-info/entry_points.txtN+I/N.,()*L/(Pz9Vy\\PKQb*DFNFFpicopt-1.6.1.dist-info/LICENSE GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. PK!HPOpicopt-1.6.1.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,szd&Y)r$[)T&UrPK!Hf picopt-1.6.1.dist-info/METADATAY]s6}ǯtf#vtuw8qC;vgg#$$a %>:U({_J'2D4Vr̟Jr+ʱ~83nT2\T։٘Յ*s'RU=S]$I\Ts?\ru"6sU@ȈWr*|/eF+UHvZ6c~xHBc.K{{Ѵ$O/ؙQ.,]tT.ث\XJb[ x'l ?~r_:2S~QTjw:DbGD5z}3UeZf~~.KiDΧri[|Lc_njlr,ͦ #qL*MϳOhE 'Y_v*$ʭJBcmw!J{6"u5,1^P:sRUʮf*d{wAQJ 6+J.:Ɛ>"i#6G(壋,NVjV1eozXDFa+a}Cȅ4DE{vvim%^u97#_(_^NGmq*C60 !FPz ߱յI%T"[g㧀bN0=^"vC~Ž,»~\:hǪ6#P-:=9RZdda+@U$#!,<4[W6)KįB@XotM)iK/goo//~`;o\4pG%>ދKxo؆m4kub5uIy g ⋪,aڂpCBDX>doԽ9ӯD>H˘NG0 N4"T&!/zO$ F)-߁ 5{@D Wq2a[(x`AvqɌl k@{*QX_Bv5qF4Lנ+ zU`kiKKћ}'Ni+ >]t8cc1c;JXC<ۦȚ臩 /vOU4bBki@^ =:Ӭ"f&odc1iʞ9 U}֫m$'E+uGa){:B4=\v8j^}_ρ: B)ǔ}PCC Gu@!!'&职c垒UCPA!!-3\D{ҙqUj߀B/TY 5 sNEZ2˝g31!`$G/ݢӐ&}jض/cCOVp%-F|Q07!ֻ U*j#2ęn0r ,KoAӜ'[# ns5pL 9moMG6.|7w4bA>:F>q]aJ$KRG .,]g qy:VY,ꞭC/Ж%{W{^%C$|u5?:۶[GŧR#$[kD^Sazd58D'aUu8N1 xP-CT $t! $݆+̷#nV$wk ]QMYM }| 2`/V,UP;fDH9۾400Fs׬Iocй g,k"ZKnnZ-BH(+L&lNjk=:8׵!;pW˭r>IKJTt,VTPK!Hc picopt-1.6.1.dist-info/RECORDuɲH}= b`RA@P`C 2$"3<}QMT]33 A0j#~B  V*G65F dPS!~4DUC8>F!nJ;2fkyؙ[b0 y+dH!L o=9Z3)5UAmͲ!h\49ҨCN~d@G줫IASEeY2d. /be27̳^( Y9RΑyALpicopt/stats.pyPKIN kSapicopt/timestamp.pyPKLnJN5,>Iqpicopt/walk.pyPKxKɂtYYGpicopt/formats/__init__.pyPKIN~=1g؋picopt/formats/comic.pyPKxKE picopt/formats/gif.pyPKxKq picopt/formats/jpeg.pyPKINA33picopt/formats/png.pyPK!Hp'*'~picopt-1.6.1.dist-info/entry_points.txtPKQb*DFNFFpicopt-1.6.1.dist-info/LICENSEPK!HPOpicopt-1.6.1.dist-info/WHEELPK!Hf \picopt-1.6.1.dist-info/METADATAPK!Hc ;picopt-1.6.1.dist-info/RECORDPKO