Python Forum
Remove duplicate images - tkinter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove duplicate images - tkinter?
#5
So far everything works as expected.

I end up just putting an image (made of a pair of images) onto a canvas and that works. I can inspect the image before deleting the duplicate. So all is well, almost.
I make use of this code:

import PIL.Image

class PhotoRec:
   'Common base class for all Photo Records - name file size location '
   recCount = 0

   def __init__(self, file_name, file_path, file_size):
      self.file_name = file_name
      self.file_path = file_path
      self.file_size = file_size
      self.twin_file = "notset" # for full path of a 'twin' if it exists
      self.thumb_img = PIL.Image.new('RGB', (128,128))
      self.make_thumb_image()
      self.delete_flag=False
      PhotoRec.recCount += 1
      
   
   def displayCount(self):
     print ("recCount = ", PhotoRec.recCount)

   def displayStuff(self):
      print ( "file_name is:",  self.file_name )
      print ( "file_path is:",  self.file_path )
      print ( "file_size is:",  self.file_size )
      print ( PhotoRec.recCount    )


   def  make_thumb_image (self):
    
      
      q2 =self.file_path + "/" + self.file_name
      temp = PIL.Image.open(q2)
      size = 128,128
      self.thumb_img = temp.resize(size   )
Now my next task is to store about 10000 small images for later use. I have read about using pickle so maybe that is what I want. I want to use those 10000 thumbnails week after week so I need to be able to save them onto my hard drive and retrieve them as needed. Would anyone know if this is a sensible way to proceed (using pickle)? Thanks.
Reply


Messages In This Thread
Remove duplicate images - tkinter? - by darter - Nov-03-2018, 10:43 PM
RE: Remove duplicate images - tkinter? - by Larz60+ - Nov-04-2018, 01:08 AM
RE: Remove duplicate images - tkinter? - by darter - Nov-04-2018, 07:27 PM
RE: Remove duplicate images - tkinter? - by darter - Nov-10-2018, 06:08 PM
RE: Remove duplicate images - tkinter? - by Larz60+ - Nov-10-2018, 10:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] TKinter Remove Button Frame Nu2Python 8 1,584 Jan-16-2024, 06:44 PM
Last Post: rob101
  Problems trying to position images with Tkinter emont 3 1,160 Dec-12-2023, 07:20 AM
Last Post: menator01
  Tkinter - How can I remove the background borders from ttk.Button? TurboC 4 17,681 Oct-18-2020, 10:58 AM
Last Post: TurboC
  [Tkinter] Loading Images to Tkinter with Pillow Tomli 2 13,436 Jun-18-2020, 03:26 AM
Last Post: Tomli
  Images in tkinter menator01 0 1,699 Apr-25-2020, 12:49 AM
Last Post: menator01
  tkInter and Pillow don't display any images in GUIs - program gives errors instead SomeRandomGuy 9 11,440 Oct-29-2019, 02:57 PM
Last Post: SomeRandomGuy
  [Tkinter] how to remove black area around the graph in tkinter ? NEL 1 2,421 Aug-03-2019, 01:48 PM
Last Post: NEL
  [Tkinter] Help with tkinter; images and button commands SheeppOSU 2 3,129 Mar-28-2019, 02:01 AM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020