# # # from PIL import Image from libs.jpg_bin import JpgBin class JpgTools: fh = None def __init__(self): pass def getJpgBin(self, fname): self.processFile(fname) # def jpgHash(self): self.fh = open(fname, "rb") self.jpg = JpgBin() retval = self.jpg.processFile(self.fh) print("processFile()=={}".format(retval)) # def processFile(self, fname): self.fh = open(fname, "rb") self.jpg = JpgBin() retval = self.jpg.processFile(self.fh) print("processFile()=={}".format(retval)) # def process_OLD(self, fname): Image.open(fname) # image as a sequence object containing pixel values bin_data = list( im.getdata() ) # returns a string containing pixel data, using the standard "raw" encoder im.tostring() # # def getJpgBin_OLD(self, fname): # img_h = Image.open(fname) # img_h.???