We have moved to a new Sailfish OS Forum. Please start new discussions there.
79

[App request]Organizing the photos in subfolders by month

asked 2015-02-28 15:58:03 +0200

bennypr0fane gravatar image

I would like to organize all the photos taken by the camera into subfolders by month, i.e. perform this action once on existing pics and then keep filing every new pic in monthly subfolders (maybe frequent shooters would even like the option to have one folder for each week, but for me monthly is certainly enough)! This is not about how the photos are viewed in the Gallery, but where/how they are stored in the file system! Who can make that happen? (note: not a duplicate of this

edit retag flag offensive close delete

Comments

1

I'd like to suggest an addition for naming the folders. (Pretty) please make it so that the folders will be named 01 January, 02 February, etc. This way they stay organized.

raketti ( 2015-02-28 19:35:50 +0200 )edit
2

@raketti I was thinking along the lines of 2015-01, 2015-02 etc. for folder names. Do you mean you want the names of months rather than numbers? If so, what would be the advantage of that? It seems to me that it would be more difficult to automate. Or what is it more precisely that you have in mind?

bennypr0fane ( 2015-02-28 21:22:38 +0200 )edit
2

@bennypr0fane no no no.. :D The names of the months weren't the point. Should have left them out, the point was the numbering. Sorry to have mislead you (or anyone else). But what you suggested would be perfect for my needs, as I already have already named my back-up folders this way. :P

raketti ( 2015-02-28 21:50:26 +0200 )edit

3 Answers

Sort by » oldest newest most voted
7

answered 2015-02-28 20:43:55 +0200

lakutalo gravatar image

updated 2015-08-03 22:20:13 +0200

I support the idea, it is more or less a standard option in cameras. In the mean time you can help yourself by using this script I have assembled here.

#!/bin/bash    
DIR=/home/nemo/Pictures/Camera
TODIR=/home/nemo/Pictures/Camera
FORMAT=+%Y-%m
cd "$DIR"
for file in *; do
if [ -f $file ]
then
dname=`date $FORMAT -r$file`
mkdir -p "$dname"
mv "$file" "$TODIR"/"$dname"
fi
done

It moves all files from your camera dir to folders like 2015-02. To be cautious, it would be a good idea to try this with other DIR and TODIR first.

To change the format of the output directory, change FORMAT from %Y-%m to whatever you like (have a look in date options). You might even use it to move or save your pictures to your sd-card by changing TODIR.

If desired the script could be launched periodically.

As precaution you should always check your sdcard's path - and alter it in the script if necessary - after you have changed or replaced it, since the mount point might change even if you reinsert the same card.

edit flag offensive delete publish link more

Comments

Actually I ran in to this and this topic about timed events. :)

raketti ( 2015-02-28 21:04:36 +0200 )edit

If we can just get this bash script without the timed option yet, that would be a great first step. We have a great app called ShellEx, that lets you store any command and launch it with a single tap. I would combine it with an Rsync command for uploading to Owncloud. Also the latest version of our Owncloud app includes an upload daemon that watches the Camera folder.

bennypr0fane ( 2015-02-28 21:19:31 +0200 )edit

Cool idea! I don't know if camera events are read out via dbus. If so you could trigger the reorganising script this way: https://together.jolla.com/question/25537/how-to-trigger-shell-scripts-on-dbus-event/ And if there is time I could create a bash prototype script, unless someone else volunteers. :)

lakutalo ( 2015-02-28 21:25:36 +0200 )edit

So what could this bash script look like? Something using mv, probably, or rename?

bennypr0fane ( 2015-02-28 21:29:57 +0200 )edit
1

You name it! :) I'd look for existing folders formatted by a template string and create if not existing. Then look up change date of picture and move it there. Of course all statements in correct order as this is too superficially described. But I am sure there are many examples to find in the depth of the ocean.

lakutalo ( 2015-02-28 21:33:41 +0200 )edit
2

answered 2015-03-02 13:20:23 +0200

netvandal gravatar image

Photos are indexed by tracker, displaying folder based on photos taken by date should be quite easy, even without moving photos around the filesystem, but using tracker data or exif metadata. There is any plan to opensource the gallery code?

edit flag offensive delete publish link more

Comments

1

Gallery view is not the topic here, it is over there: https://together.jolla.com/question/1948/feature-request-folderalbum-view-in-gallery/

bennypr0fane ( 2015-03-02 13:24:17 +0200 )edit

ups, sorry, i understood the question on the wrong side :)

netvandal ( 2015-03-02 13:29:01 +0200 )edit

no prob, any idea much appreciated!

lakutalo ( 2015-03-02 13:50:58 +0200 )edit
1

answered 2015-03-07 01:21:30 +0200

Odorobo gravatar image

updated 2015-03-07 01:21:53 +0200

I'd support any organisation of photos in gallery except current.
Also, sharing for awareness/voting: https://together.jolla.com/question/8882/organize-photopictures-gallery-by-year-and-month/ https://together.jolla.com/question/1948/feature-request-folderalbum-view-in-gallery/ https://together.jolla.com/question/2257/exclude-folders-from-gallery/ https://together.jolla.com/question/72706/feature-request-sorting-out-pictures-in-gallery/ https://together.jolla.com/question/33373/settings-tracker-indexing-configuration/ https://together.jolla.com/question/5935/how-to-blacklist-directories-from-being-indexed-by-tracker/

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
8 followers

Stats

Asked: 2015-02-28 15:58:03 +0200

Seen: 990 times

Last updated: Aug 03 '15