def auto(f, args): """ Input: f -- PIL Image file args -- arg parsed arguments Action: Based on file type, checks for trailing information in file. Print and save if found. Returns: Nothing """ try: if f.format == "JPEG": jpeg(f, args) elif f.format == "TIFF": tiff(f, args) elif f.format == "PNG": png(f, args) elif f.format == "BMP": bmp(f, args) elif f.format == "GIF": gif(f, args) else: print("Image Trailing: No support yet for format {0}".format( f.format)) return except: print( "Image Trailing: Something went wrong... please submit a bug report" )
def auto(f,args): """ Input: f -- PIL Image file args -- arg parsed arguments Action: Based on file type, checks for trailing information in file. Print and save if found. Returns: Nothing """ try: if f.format == "JPEG": jpeg(f,args) elif f.format == "TIFF": tiff(f,args) elif f.format == "PNG": png(f,args) elif f.format == "BMP": bmp(f,args) elif f.format == "GIF": gif(f,args) else: print("Image Trailing: No support yet for format {0}".format(f.format)) return except: print("Image Trailing: Something went wrong... please submit a bug report")
def convert(f, output=sys.stdout): """Convert Plan 9 file to PNG format. Works with either uncompressed or compressed files. """ r = f.read(11) if r == 'compressed\n': png(output, *decompress(f)) else: png(output, *glue(f, r))
def convert(f, output=sys.stdout) : """Convert Plan 9 file to PNG format. Works with either uncompressed or compressed files. """ r = f.read(11) if r == 'compressed\n' : png(output, *decompress(f)) else : png(output, *glue(f, r))