pkolarov / folders2flickr

Automatically exported from code.google.com/p/folders2flickr
7 stars 2 forks source link

Checking for Duplicate pictures according to filename and datetaken. More accurate #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I added some code to check for duplicate pictures before uploading.  It checks 
against filename and date taken.

                user = flickr.test_login()
                no_duplicate = True
                #double check for duplicate images
                if exiftags != {}:
                    datetaken_photos = flickr.photos_search(user_id=user.id, text=os.path.basename(image), extras="date_taken")
                    for dt in datetaken_photos:
                        if(dt.datetaken.replace('-',':') == str(exiftags["Image DateTime"])):
                            no_duplicate = False
                            logging.debug("found duplicate picture, skip")
                            self.logUpload(dt.id, folderTag )

Original issue reported on code.google.com by lim...@gmail.com on 28 Jul 2010 at 6:10

GoogleCodeExporter commented 9 years ago
I'm using this to check Video duplicates.  Not that accurate though in case 
your file names get reused.  Worked for me though.

                if(no_duplicate):
                    sametag_photos = flickr.photos_search(user_id=user.id, text=os.path.basename(image), media="video")
                    logging.debug(out)
                    if (sametag_photos or len(sametag_photos) > 0):
                        no_duplicate = False
                        logging.debug("found duplicate video, skip")     
                        self.logUpload(sametag_photos[0].id, folderTag )

Original comment by lim...@gmail.com on 28 Jul 2010 at 6:11

GoogleCodeExporter commented 9 years ago
isn't committed yet.  What do you think Peter?

Original comment by lim...@gmail.com on 28 Jul 2010 at 6:11

GoogleCodeExporter commented 9 years ago
also, 'extras' and 'media' need to be added in flickr.py

Original comment by lim...@gmail.com on 28 Jul 2010 at 6:21

GoogleCodeExporter commented 9 years ago
Yes, this is a good idea, the time stamp along with file name should be good 
unique identifier, go ahead and commit it if it works, may be with some 
comments around so I can later test it as well when I get around coding this 
again ;)

Original comment by pkola...@gmail.com on 8 Sep 2010 at 9:02

GoogleCodeExporter commented 9 years ago

Original comment by pkola...@gmail.com on 4 Feb 2011 at 12:44

GoogleCodeExporter commented 9 years ago

Original comment by pkola...@gmail.com on 4 Feb 2011 at 12:46

GoogleCodeExporter commented 9 years ago
how and where do you add those codes?

Original comment by dcw...@gmail.com on 22 May 2013 at 8:02

GoogleCodeExporter commented 9 years ago
It's been awhile since I've used this code but I believe it is after line 304 
on the uploadr.py file.  You can add that function after "def uploadImage( 
self, image ):"

Original comment by lim...@gmail.com on 22 May 2013 at 9:12

GoogleCodeExporter commented 9 years ago
I have added it but when I try to run the uploadr.py, I get the following error.

  File "uploadr.py", line 318
    if ( not self.uploaded.has_key( folderTag ) ):
                                                 ^
IndentationError: unindent does not match any outer indentation level

Original comment by dcw...@gmail.com on 24 May 2013 at 7:31

GoogleCodeExporter commented 9 years ago
Hi,
I have added support for updating pictures if they changed locally in the file 
system. Flickr allows you to upload the same file multiple times, I think that 
if you have a duplicated file in your file system, folders2flickr should upload 
it no matter what. It must replicate local data to Flickr, that's the intention 
of this project.

Regarding updates, that's different because let's say that you a jpg in your 
file system that you loaded from your camera Today, during the night the 
scheduler triggers folder2flickr so the file gets uploaded. Tomorrow you edit 
this jpg because you wanted to crop it or whatever, you would really like to 
see these changes replicated into Flickr (without having to do any manual thing 
or duplicating files) so, the code has been added into this bug:
http://code.google.com/p/folders2flickr/issues/detail?id=29

Hope this will help you!
Regards

Original comment by gsfernan...@gmail.com on 8 Jul 2013 at 3:06

GoogleCodeExporter commented 9 years ago
Any more updates to this code?

Original comment by Prayerfu...@gmail.com on 18 Sep 2013 at 1:40

GoogleCodeExporter commented 9 years ago
Sorry no updates

Original comment by lim...@gmail.com on 18 Sep 2013 at 5:11

GoogleCodeExporter commented 9 years ago
This method will work well enough until you encounter a photo that doesn't have 
correct EXIF data. In this case, the datetaken of the photo will be set to be 
the date it was uploaded (a terrible, terrible idea...)

This will confuse folders2Flickr.

Original comment by fushunpoon@googlemail.com on 13 Oct 2013 at 2:09