( self, zoom )
Implement Record Sequence
Implement Record Sequence
Implement Record Sequence
def LoadImageFromStream ( self, zoom ):
		if self.photo: del self.photo

		self.pictureStream.seek(0)
		self.CurrentImage = PIL.Image.open(self.pictureStream)
		# https://pillow.readthedocs.io/en/3.1.x/reference/Image.html#the-image-class
		self.RawEXIFData = None
		if PreferencesDialog.DefaultPhotoFormat == 'jpeg':
			self.RawEXIFData = self.CurrentImage.info['exif']	# Works!!!!
			#print ( self.RawEXIFData )
		self.CameraUtils.AddEXIFTags(self.CurrentImage)
		self.ShowHideImageAttributesPane(self.viewImageAttributesPane.get())

		# resize what's displayed if user used Ctrl+mousewheel
		size = self.CurrentImage.size
		if size[0] <= 1024 and size[1] <= 768:	# hold max zoom level
			width = int(zoom*size[0])
			height = int(zoom*size[1])
			if width <= 1024 and height <= 768:
				self.CurrentImage = self.CurrentImage.resize((width,height),PIL.Image.ANTIALIAS)
		self.CurrentImageSize = self.CurrentImage.size

		# Convert to canvas compatible format and store on canvas
		self.photo = ImageTk.PhotoImage(self.CurrentImage)
		self.photoCanvas.delete("pic")
		self.photoCanvas.create_image(0,0,image=self.photo,anchor='nw',tags=('pic'))
		self.photoCanvas.config(scrollregion=self.photoCanvas.bbox(ALL))
		self.photoCanvas.tag_raise("objs") # raise Z order of cursors to topmost
		'''
			Implement Record Sequence
		'''
def LoadImageFromStream ( self , zoom ) : if self . photo : del self . photo self . pictureStream . seek ( 0 ) self . CurrentImage = PIL . Image . open ( self . pictureStream ) # https://pillow.readthedocs.io/en/3.1.x/reference/Image.html#the-image-class self . RawEXIFData = None if PreferencesDialog . DefaultPhotoFormat == 'jpeg' : self . RawEXIFData = self . CurrentImage . info [ 'exif' ] # Works!!!! #print ( self.RawEXIFData ) self . CameraUtils . AddEXIFTags ( self . CurrentImage ) self . ShowHideImageAttributesPane ( self . viewImageAttributesPane . get ( ) ) # resize what's displayed if user used Ctrl+mousewheel size = self . CurrentImage . size if size [ 0 ] <= 1024 and size [ 1 ] <= 768 : # hold max zoom level width = int ( zoom * size [ 0 ] ) height = int ( zoom * size [ 1 ] ) if width <= 1024 and height <= 768 : self . CurrentImage = self . CurrentImage . resize ( ( width , height ) , PIL . Image . ANTIALIAS ) self . CurrentImageSize = self . CurrentImage . size # Convert to canvas compatible format and store on canvas self . photo = ImageTk . PhotoImage ( self . CurrentImage ) self . photoCanvas . delete ( "pic" ) self . photoCanvas . create_image ( 0 , 0 , image = self . photo , anchor = 'nw' , tags = ( 'pic' ) ) self . photoCanvas . config ( scrollregion = self . photoCanvas . bbox ( ALL ) ) self . photoCanvas . tag_raise ( "objs" ) # raise Z order of cursors to topmost