diff --git a/_scripts/generate-gallery.php b/_scripts/generate-gallery.php index 00d9f62..324f969 100644 --- a/_scripts/generate-gallery.php +++ b/_scripts/generate-gallery.php @@ -58,6 +58,7 @@ $oConsole foreach (glob($sDir . '/*.[jJ][pP][gG]') as $i => $sFile) { // Generate id from file contents $sId = substr(sha1_file($sFile), 0, 7); + $sId[0] = $sId[0] == '0' ? '1' : $sId[0]; $oOutput->write('' . $sId . ''); // Parse selected EXIF data diff --git a/_scripts/photo-ids.php b/_scripts/photo-ids.php index 51dcfb3..7f35236 100644 --- a/_scripts/photo-ids.php +++ b/_scripts/photo-ids.php @@ -4,7 +4,8 @@ if (!isset($argv[1]) || !is_dir($argv[1])) { } $sPath = realpath($argv[1]); foreach (glob($sPath . '/*.jpg') as $sFile) { - $sId = substr(sha1_file($sFile), 0, 7); + $sId = substr(sha1_file($sFile), 0, 7); + $sId[0] = $sId[0] == '0' ? '1' : $sId[0]; $sBasename = basename($sFile, '.jpg'); printf("%s => %s\n", $sBasename, $sId); $sNewFile = str_replace($sBasename, $sId, $sFile);