Skip to content

We take a catalog with photos and videos. We indicate where we want to move it. Run the script and voila! All files are beautifully sorted by years and months.

Notifications You must be signed in to change notification settings

Savin-Igor/sorting-photos

Repository files navigation

Sorting Photos By Date

We take a catalog with photos and videos. We indicate where we want to move it. Run the script and voila! All files are beautifully sorted by years and months.

Example

Sample code from the index php file (run from the console - php index.php):

<?php

declare(strict_types=1);

use SortingPhotosByDate\Services\Sorter;

require_once __DIR__.'/vendor/autoload.php';

error_reporting(E_ALL);
ini_set('display_errors', '1');
ini_set('memory_limit', '550M');
ini_set('display_startup_errors', '1');

$unsortedPhotosDir = __DIR__.'/fotos';
$copyToDir = __DIR__.'/sorted-fotos';

try {
    $sorter = new Sorter($unsortedPhotosDir, $copyToDir, $psrLogger);
    $sorter->process();
} catch (Throwable $throwable) {
    printf("[%s] %s \n", $throwable::class, $throwable->getMessage());
}

API documentation

You can familiarize yourself with the library interfaces in this documentation

About

We take a catalog with photos and videos. We indicate where we want to move it. Run the script and voila! All files are beautifully sorted by years and months.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages