#
#
#
import logging
from PIL import Image
from libs.jpg_bin import JpgBin


class JpgTools:

  def __init__(self):
    self.fh = None
    pass

  #
  # process a jpg file, read only
  #
  def getJpgBin(self, fname):
    self.fh = open(fname, "rb")
    self.jpg = JpgBin()
    retval = self.jpg.processFile(self.fh)
    logging.info("processFile()=={}".format(retval))
    return self.jpg

  #
  # process a jpg file, create new jpg with crypto keys
  #
  def jpgHash(self):
    self.fh = open(fname, "rb")
    self.jpg = JpgBin()
    retval = self.jpg.processFile(self.fh)
    logging.info("processFile()=={}".format(retval))

