def __init__(self, image_path, data_boxes = []): image = Image.open(image_path) self.pixel_width, self.pixel_height = image.size self.image_path = image_path self.setSize(getImagePrintSize(image)) self.resolution = getImageResolution(image) self.data_boxes = data_boxes
def __init__(self, name, image_path): width, height = getImagePrintSize(image_path) self.document = canvas.Canvas(name, pagesize=(width * inch, height * inch))