def exif_orientation(self): """ Exif orientation value as a number between 1 and 8. Property is read/write """ try: return lib.Exif(self.data).orientation except lib.ExifException: return None
def exif_thumbnail(self, image): if isinstance(image, JPEGImage): data = image.data elif isinstance(image, str): data = bytearray(image) else: data = image if not self.exif_thumbnail: raise ValueError("No pre-existing thumbnail found, cannot set.") lib.Exif(self.data).thumbnail = data
def exif_thumbnail(self): """ EXIF thumbnail. :return: EXIF thumbnail in JPEG format :rtype: str """ try: return JPEGImage(blob=lib.Exif(self.data).thumbnail) except lib.ExifException: return None
def exif_orientation(self, value): if not 0 < value < 9: raise ValueError("Orientation value must be between 1 and 8") lib.Exif(self.data).orientation = value