{"id":650,"date":"2009-11-28T14:33:14","date_gmt":"2009-11-28T14:33:14","guid":{"rendered":"http:\/\/really.zonky.org\/?p=650"},"modified":"2010-01-31T16:06:41","modified_gmt":"2010-01-31T16:06:41","slug":"creating-a-date-based-photo-repository-examining-results","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=650","title":{"rendered":"Creating A Date-Based Photo Repository &#038; Examining Results"},"content":{"rendered":"<p>Because of a little &#8220;issue&#8221; with Bibble which causes that software to cease responding when navigating the browser <em>whilst<\/em> it is updating the icons, I had to come up with a different way of storing my raw images. Or at least a different &#8220;shadow view&#8221; that would allow Bibble to work more reliably. I had been thinking on what would be the best way (for me!) of doing this for a while now, and this morning spent about 45minutes knocking up some code to do what I wanted.<\/p>\n<p>I chose to use the &#8220;date&#8221; contained within the Exif information within each file to produce a directory structure along the lines of &#8220;\/some\/place\/YYYY-MM-DD\/original-name-of-file&#8221; with the file at the bottom level being a symlink back to the original file. I chose not to <em>move<\/em> any files around as I could more easily fix things if the code I had written did Something Stupid. I chose not to <em>copy<\/em> any files, as I did not want to duplicate some 100Gbytes of RAW files if I did not need to &#8212; and I did not as symlinks can do the job perfectly well.<\/p>\n<p>As for the choice of the date format, well I have long preferred the ISO date format in places where a conventionally human readable date was not necessary or would be inconvenient. The ISO date format is useful in that it is not subject to misinterpretation as date formats such as &#8220;DD-MM-YY&#8221; and &#8220;MM-DD-YY&#8221; are, and it happens to sort easily with the <em>ls<\/em> command &#8211; which is much more useful than you would think. If it looks a little odd, just start using it and get used to it.<\/p>\n<p>The code itself is available <a href=\"http:\/\/zonky.org\/src\/mk-photo-date-dirs\">here<\/a> if you really want to get hold of it (I wouldn&#8217;t bother if I were you &#8211; it&#8217;s just something knocked up in a rush that works ok for me).<\/p>\n<p>The interesting thing about the new &#8220;repository&#8221; was that it was easy to produce a table of dates and the number of photos taken on those dates :-<\/p>\n<pre>cd \/media\/photos\/raw.dated\r\nfor i in $(echo *)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\ndo\r\n  echo -n \"$i \"; ls $i\/* | wc -l\r\ndone<\/pre>\n<p>The output is long enough and boring enough (for anyone other than me) that I will not include it here. But it is relatively easy to turn this into a graph using ploticus :-<\/p>\n<pre>ploticus -prefab chron \\\r\n  -o photos.png \\\r\n  -png \\\r\n  data=dates.dat x=1 y=2 \\\r\n  datefmt=yyyy-mm-dd \\\r\n  color=blue \\\r\n  echodata=no \\\r\n  xinc='1 year' \\\r\n  stubfmt='MMM YY'<\/pre>\n<p>This produced a graph similar to :-<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-661\" title=\"Photo Frequency\" src=\"https:\/\/i0.wp.com\/really.zonky.org\/wp-content\/uploads\/photo-frequency.png?resize=548%2C270\" alt=\"Photo Frequency\" width=\"548\" height=\"270\" \/><\/p>\n<p>I seem to be taking more photos over time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Because of a little &#8220;issue&#8221; with Bibble which causes that software to cease responding when navigating the browser whilst it is updating the icons, I had to come up with a different way of storing my raw images. Or at least a different &#8220;shadow view&#8221; that would allow Bibble to work more reliably. I had <a href='https:\/\/really.zonky.org\/?p=650' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[4,8],"tags":[1331,45],"class_list":["post-650","post","type-post","status-publish","format-standard","hentry","category-it","category-photography","tag-photography","tag-scripting","category-4-id","category-8-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-au","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=650"}],"version-history":[{"count":7,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/650\/revisions"}],"predecessor-version":[{"id":660,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/650\/revisions\/660"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}