コード例 #1
0
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"
        )
コード例 #2
0
ファイル: imageTrailing.py プロジェクト: Owlz/StegoDone
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")
コード例 #3
0
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))
コード例 #4
0
ファイル: plan9topng.py プロジェクト: brechtm/purepng
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))