Friday, 3 April 2026

Finding Duplicate Photos in Amazon Photos with a Terminal Command

If you use Amazon Photos to back up your pictures, you might have noticed something frustrating over time: duplicate photos. It happens to everyone — you upload a batch of photos twice, you edit a picture and keep both versions, or your phone syncs a photo you already had. Before you know it, your library is cluttered with copies you don't even remember making.                                    

I recently built a command-line tool that connects to your Amazon Photos library and automatically finds those duplicates for you. Let me walk you through how it works.                                  

                                                                                                                                                 The problem with finding duplicates the old way                                                                                                                                                          

The naive approach to finding duplicate files is to compare them byte by byte — if two files are identical down to the last bit, they're duplicates. But photos don't work that well like that. The same picture can exist in your library in slightly different forms: different compression, a small crop, a brightness tweak, or even a different file format (JPEG vs. PNG). Byte-by-byte comparison would miss all of those.                                                                                                                                                                                            

How the tool actually detects duplicates

The tool uses a technique called perceptual hashing. Instead of comparing raw file data, it looks at what the image looks like to the human eye. It converts each photo into a compact "fingerprint" that  captures its visual content, then measures how similar two fingerprints are — giving a percentage from 0% (completely different) to 100% (visually identical).

This means it can detect duplicates even when the files are technically different, as long as the pictures look the same. 

                                                                             

A two-phase process to avoid downloading everything                                                                                                                                                       

Downloading and visually comparing thousands of photos one by one would take forever. The tool is smarter than that: it first does a quick metadata pass to narrow down candidates.

Photos with the same filename, or taken at the exact same second, are very likely to be duplicates. The tool groups those photos together first — without downloading any images. Only then does it download and visually compare the photos within each group. This makes the whole process much faster.


Running the command                                                                                                                                                                                       

The command is photos:find-duplicates. In its simplest form, you just run it and let it scan your entire library:                                                                                         

php artisan photos:find-duplicates                                                                                                                                                                        

You can also narrow things down. For example, to only look at photos uploaded in the last 30 days:                                                                                                        

 php artisan photos:find-duplicates --uploaded-last-days=30                                                                                                                                                

 Or to compare photos taken within a specific date range:

 php artisan photos:find-duplicates --taken-between=01/01/2024,31/12/2024                                                                                                                                  

By default, it groups candidate duplicates by filename. You can also group by the timestamp when the photo was taken, or both at once:                                                                    

php artisan photos:find-duplicates --group-by=taken-at                                                                              php artisan photos:find-duplicates --group-by=name-and-taken-at


The similarity threshold defaults to 90% — photos that look at least 90% alike are flagged as duplicates. You can make it stricter or more lenient:                                                       

php artisan photos:find-duplicates --similarity=95                                                                                                                                                        

Comparing two specific photos                                                                                                                                                                             

Sometimes you already suspect two specific photos are duplicates. Instead of scanning the whole library, you can compare just those two by passing their IDs directly:                                    

php artisan photos:find-duplicates photo-id-1 photo-id-2                                                                                                                                                  

 The tool will tell you the similarity percentage and whether they're considered duplicates. 


More info: https://github.com/icsbcn/awsphotosapi                                                                                                         

Wednesday, 1 April 2026

Never Lose a Photo Again: How I Built a Tool to Organize My Amazon Photos

If you use Amazon Photos to store your pictures, you probably know how easy it is to end up with hundreds — or even thousands — of photos just sitting there, not organized in any album. That was exactly my problem.

I love taking photos. But organizing them? Not so much. Over the years I accumulated a huge collection on Amazon Photos, and most of it was just a big unsorted pile. Albums existed, but plenty of photos never made it into one.

So I built a small tool to help me fix that.

Sunday, 9 March 2025

Nodes 2: Renovation of the websites of the Àgora educational centers

 https://ithinkupc.com/en/news/nodes-2-renovation-of-the-websites-of-the-agora-educational-centers/

Thursday, 6 March 2025

Xampp: Cannot create file "C:\xampp-control.ini"

It may happen that sometimes when installing and/or using xampp on Windows without administrative permissions this message appears.

In this case, my recommendation is to gain administrative permissions for a while and do:

  1. In the directory where xampp is installed, give "full control" permissions to all users for these 2 files:
    1. xampp-control.exe
    2. xampp-control.ini
Regards!

Tuesday, 25 July 2017

Moodle: Force users to viewn default "My Moodle"

Hello,

The best option to control content of "my" section and prevent users from changing settings is:

- Add in config.php this line:

$CFG->forcedefaultmymoodle = true;

Best regards,
Iban Cardona.

Thursday, 13 July 2017

Moodle: Change course name in breadcrumb

Hello,

If you want to modify the text of the a course in the breadcrumb you can do this (tested in Moodle 3.2):

Add this function in your file lib.php of your local plugin:

function local_yourlocalplugin_extend_navigation(global_navigation $nav) {
    global $COURSE, $CFG;

    if (isset($COURSE->id) && $COURSE->id > 0) {
        $coursenode = $nav->find($COURSE->id, navigation_node::TYPE_COURSE);
        if ($coursenode) {
                $coursenode->text .= ' My extra text';
        }
    }
}

Best regards!

Monday, 15 May 2017

Moodle & PHPUnit: Capture events

Hello,

If you want to tests events in Moodle using PHPUnit, the best method is:

public function test_creationg_event() {
        $this->resetAfterTest();
        $event_sink = $this->redirectEvents();

        $course = $this->getDataGenerator()->create_course();

        $events = $event_sink->get_events();
        $event_sink->close();
        $event = $events[0];
        $this->assertInstanceOf('\core\event\course_created', $event);
}

Best regards!