Recover accidentally deleted photos

This commit is contained in:
2016-02-08 20:49:49 +00:00
parent 97f3025259
commit 665ca58988
18 changed files with 217 additions and 17 deletions

View File

@@ -299,4 +299,12 @@ photos:
date: 2013-12-07 17:55:47
file: IMAG0837
model: One S
make: HTC
make: HTC
6d7af47:
date: 2013-12-07 17:55:47
file: IMAG0838
model: HTC One S
make: HTC
8018b99:
date: 2013-12-07 17:55:47
file: 600637_618323824857695_1516367655_n

View File

@@ -209,4 +209,11 @@ photos:
file: IMAG0782
model: One S
width: 1920
make: HTC
make: HTC
8e54ead:
date: 2013-12-07 17:31:11
file: IMAG0781
model: HTC One S
make: HTC
latitude: 56.3393135
longitude: -2.7945372777778

View File

@@ -141,4 +141,14 @@ photos:
date: 2014-05-19 08:34:32
file: PANO_20140518_141508
latitude: 55.639819444444
longitude: -0.68065833333333
longitude: -0.68065833333333
4643244:
date: 2014-05-19 08:34:32
file: PANO_20140518_113959
latitude: 56.22285
longitude: -2.7071722222222
ec705f1:
date: 2014-05-19 08:34:32
file: PANO_20140518_112526
latitude: 56.222744444444
longitude: -2.7077527777778

View File

@@ -446,4 +446,17 @@ photos:
make: Sony
df40ee2:
date: 2014-05-25 13:09:44
file: PANO_20140524_152048
file: PANO_20140524_152048
066177d:
date: 2014-05-25 13:09:44
file: PANO_20140524_160040
latitude: 55.944041666667
longitude: -3.1618416666667
3bebd47:
date: 2014-05-25 13:09:44
file: PANO_20140524_111408
latitude: 55.948394444444
longitude: -3.1978972222222
95aeb72:
date: 2014-05-25 13:09:44
file: PANO_20140524_142858

View File

@@ -78,4 +78,4 @@ photos:
date: 2014-12-21 10:43:49
file: IMG_20141221_104348
latitude: 46.207992527778
longitude: 6.1467237222222
longitude: 6.1467237222222 { } { }

View File

@@ -66,4 +66,4 @@ photos:
date: 2014-12-21 11:59:10
file: IMG_20141221_115909
latitude: 46.201538083333
longitude: 6.1467084722222
longitude: 6.1467084722222 { } { }

View File

@@ -70,4 +70,4 @@ photos:
date: 2014-12-21 12:02:28
file: IMG_20141221_120228
latitude: 46.201538083333
longitude: 6.1467084722222
longitude: 6.1467084722222 { } { }

View File

@@ -72,4 +72,7 @@ photos:
make: HTC
35969f0:
date: 2014-03-12 20:19:54
file: PANO_20140309_133459
file: PANO_20140309_133459
28cbfc4:
date: 2014-03-12 20:19:54
file: PANO_20140309_115722

View File

@@ -153,4 +153,15 @@ photos:
longitude: -3.7712606944444
e20d261:
date: 2014-06-23 21:02:14
file: PANO_20140622_123025
file: PANO_20140622_123025
1385d9b:
date: 2014-06-23 21:02:14
file: PANO_20140622_120421
78c2dbe:
date: 2014-06-23 21:02:14
file: PANO_20140622_140605
latitude: 56.741627777778
longitude: -3.839725
e032e00:
date: 2014-06-23 21:02:14
file: PANO_20140622_135043

View File

@@ -1,5 +1,6 @@
title: Movember
date: 2014-11-29
ignore: true
map:
latitude: 56.330320722222
longitude: -2.8101396611111
@@ -13,4 +14,19 @@ photos:
date: 2014-11-29 11:00:21
file: IMG_20141129_110020
latitude: 56.330303166667
longitude: -2.8099873055556
longitude: -2.8099873055556
786a35e:
date: 2014-11-29 11:00:21
file: IMG_20141129_110020
latitude: 56.330303166667
longitude: -2.8099873055556
9cab68f:
date: 2014-11-29 10:57:58
file: IMG_20141129_105757
latitude: 56.330329888889
longitude: -2.8101723333333
a4ee560:
date: 2014-11-29 10:49:55
file: IMG_20141129_104954
latitude: 56.330326055556
longitude: -2.8101895

View File

@@ -99,4 +99,4 @@ photos:
model: One S
make: HTC
latitude: 56.330379472222
longitude: -2.8101570555556
longitude: -2.8101570555556 { } { }

View File

@@ -298,4 +298,11 @@ photos:
file: DSCF0599
model: XQ1
width: 1920
make: Fujifilm
make: Fujifilm
76a9939:
aperture: f/4.0
date: 2016-01-01 14:55:30
exposure: 1/600
file: DSCF0599
model: XQ1
make: FUJIFILM

View File

@@ -7,4 +7,22 @@ photos:
file: 12094965_10208572406014090_7417930256676720204_o
f92cb12:
date: 2015-10-11 19:24:16
file: 12095200_10208572408214145_4494281446369998512_o
file: 12095200_10208572408214145_4494281446369998512_o
159af96:
date: 2015-10-11 19:24:15
file: 12138416_10208572406774109_8628238848178636432_o
2f9307a:
date: 2015-10-11 19:24:15
file: 12091471_10208572407134118_2594502607368021964_o
9d94ffb:
date: 2015-10-11 19:24:15
file: 12068760_10208572405334073_6087250796166905161_o
a594115:
date: 2015-10-11 19:24:16
file: 12139952_10208572571098217_1495840514043835842_o
c8300eb:
date: 2015-10-11 19:24:15
file: 12068827_10208572408174144_2208095789580445463_o
dc4bc59:
date: 2015-10-11 19:24:16
file: 12113351_10208572406174094_405399753629764576_o

View File

@@ -4,4 +4,13 @@ ignore: true
photos:
f848391:
date: 2015-04-13 20:18:19
file: 11134117_920154821376680_4287747001196347043_o
file: 11134117_920154821376680_4287747001196347043_o
97e5072:
date: 2015-04-13 20:18:19
file: 11157555_920154954710000_1350718057890287660_o
cc35dbd:
date: 2015-04-13 20:18:19
file: 11154743_920154891376673_6677765958967146059_o
f026829:
date: 2015-04-13 20:18:19
file: 11154985_868827193189095_60740552288967563_o

View File

@@ -10,6 +10,16 @@ photos:
date: 2015-08-23 18:09:17
file: IMG_20150823_180916
3cb29a9:
date: 2015-08-26 08:23:50
file: IMG_20150826_082349
latitude: 56.330360388889
longitude: -2.80978825
64e4ca4:
date: 2015-08-26 08:23:37
file: IMG_20150826_082336
latitude: 56.330368027778
longitude: -2.8097918055556
b607f9c:
date: 2015-08-26 08:23:50
file: IMG_20150826_082349
latitude: 56.330360388889

View File

@@ -30,6 +30,11 @@ photos:
latitude: 56.339733111111
longitude: -2.8075528333333
1e22bf5:
date: 2015-03-20 09:43:59
file: IMG_20150320_094357
latitude: 56.339786527778
longitude: -2.8074884166667
95b98c7:
date: 2015-03-20 09:43:59
file: IMG_20150320_094357
latitude: 56.339786527778

View File

@@ -1,9 +1,7 @@
<?php
require __DIR__ . '/utilities.php';
use Symfony\Component\Yaml\Yaml;
foreach (glob('_data/gallery/*.yml') as $sFile) {
foreach (glob('C:\Users\Rik\Downloads\yy/*.yml') as $sFile) {
yamlParse($sFile, $aYaml, $sContents);
preg_match_all('~\s{2}(\w{7}):\n~', $sContents, $aMatches);
$aPhotos = $aMatches[1];

View File

@@ -0,0 +1,85 @@
<?php
require __DIR__ . '/utilities.php';
$sAssetDir = __DIR__ . '/../../asset/gallery';
$sDataDir = __DIR__ . '/../_data/gallery';
$sFixDir = __DIR__ . '/../../x/gallery';
$bFix = true;
// Scan for photo files
$aFiles = [];
foreach (glob(sprintf('%s%s*', $sAssetDir, DIRECTORY_SEPARATOR)) as $sGalleryDir) {
$sGallery = basename($sGalleryDir);
$aPhotos = [];
foreach (glob(sprintf('%s%s*', $sGalleryDir, DIRECTORY_SEPARATOR)) as $sFile) {
$sPhoto = basename($sFile, '.jpg');
list($sName, $sDimension) = explode('~', $sPhoto);
if (isset($aPhotos[$sName])) {
$aPhotos[$sName][] = $sDimension;
} else {
$aPhotos[$sName] = [$sDimension];
}
}
$aFiles[$sGallery] = array_keys($aPhotos);
}
// Scan for gallery photos
foreach (glob(sprintf('%s%s*.yml', $sDataDir, DIRECTORY_SEPARATOR)) as $sFile) {
yamlParse($sFile, $aYaml, $sContents);
preg_match_all('~\s{2}(\w{7}):\n~', $sContents, $aMatches);
$aPhotos = $aMatches[1];
$sGallery = basename($sFile, '.yml');
// Check match
if (!isset($aFiles[$sGallery])) {
printf("[%s] no files!\n", $sGallery);
}
// Compare
$aFileOnly = array_diff($aFiles[$sGallery], $aPhotos);
$aReferenceOnly = array_diff($aPhotos, $aFiles[$sGallery]);
$bFileOnly = count($aFileOnly) > 0;
$bReferenceOnly = count($aReferenceOnly) > 0;
// Display results
if ($bFileOnly || $bReferenceOnly) {
printf("[%s]\n", $sGallery);
}
if ($bFileOnly) {
printf(" files:\n - %s\n", implode("\n - ", $aFileOnly));
if ($bFix) {
$aFix = [];
foreach ($aFileOnly as $sPhoto) {
$sPhotoFile = sprintf('%s%s%s%s%s.md', $sFixDir, DIRECTORY_SEPARATOR, $sGallery, DIRECTORY_SEPARATOR, $sPhoto);
if (!file_exists($sPhotoFile)) {
printf(" <%s> non existent!\n", $sPhoto);
continue;
}
parseFile($sPhotoFile, $aPhotoYaml);
unset($aPhotoYaml['gallery']);
unset($aPhotoYaml['layout']);
unset($aPhotoYaml['next']);
unset($aPhotoYaml['ordering']);
unset($aPhotoYaml['previous']);
unset($aPhotoYaml['sizes']);
unset($aPhotoYaml['title']);
if (!isset($aPhotoYaml['date'])) {
printf(" <%s> no date!\n", $sPhoto);
continue;
} else {
$aPhotoYaml['date'] = date('Y-m-d H:i:s', $aPhotoYaml['date']);
}
if (isset($aPhotoYaml['location'])) {
$aPhotoYaml = array_merge($aPhotoYaml, $aPhotoYaml['location']);
unset($aPhotoYaml['location']);
}
$aFix[$sPhoto] = $aPhotoYaml;
}
$sFix = substr(yamlDump(array('' => $aFix)), 1);
file_put_contents($sFile, trim(sprintf("%s%s", file_get_contents($sFile), $sFix)));
}
}
if ($bReferenceOnly) {
printf(" references:\n - %s\n", implode("\n - ", $aReferenceOnly));
}
}