Announcement

#1 2021-11-30 18:46:19

Redletter20
Member
2021-11-30
5

Is there any way to view albums or tags as a virtual file system?

Hello, I am considering setting up Piwigo and giving it a try, but I’m very curious about one thing.

Is there any way, officially or otherwise to view virtual albums, and/or tags as if they are folders in a file system? This way my organization I’ve done in Piwigo can be accessed from any other program as well.

There was a project that did just this but for the Linux photo manager Shotwell. It can still be found on GitHub https://github.com/moses-palmer/photofs

Offline

 

#2 2021-11-30 19:02:24

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

I use the plugin called "Smart Albums" to do this specifically - check it out, works for me.

https://piwigo.org/ext/extension_view.php?eid=544

The limitation being that you have to create each 'smart' album to begin with.  This is a tad burdensome  (IE: I do Christmas ones based on date frame, tag, etc. and each year have to do the same thing again but with the different criteria)

Offline

 

#3 2021-11-30 20:31:30

Redletter20
Member
2021-11-30
5

Re: Is there any way to view albums or tags as a virtual file system?

jnashpiwigo wrote:

I use the plugin called "Smart Albums" to do this specifically - check it out, works for me.

https://piwigo.org/ext/extension_view.php?eid=544

The limitation being that you have to create each 'smart' album to begin with.  This is a tad burdensome  (IE: I do Christmas ones based on date frame, tag, etc. and each year have to do the same thing again but with the different criteria)

That is actually really cool. I dont mind making the albums manually. However once an album is created is it accessible from outside of Piwigo via the file system or other methods? I dont see any mention of being able to do that on the plugins page or Github.

Offline

 

#4 2021-11-30 20:40:27

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

Redletter20 wrote:

jnashpiwigo wrote:

I use the plugin called "Smart Albums" to do this specifically - check it out, works for me.

https://piwigo.org/ext/extension_view.php?eid=544

The limitation being that you have to create each 'smart' album to begin with.  This is a tad burdensome  (IE: I do Christmas ones based on date frame, tag, etc. and each year have to do the same thing again but with the different criteria)

That is actually really cool. I dont mind making the albums manually. However once an album is created is it accessible from outside of Piwigo via the file system or other methods? I dont see any mention of being able to do that on the plugins page or Github.

No, it's truly 'virtual' only.  My apologies that I didn't quite read your initial request well enough.

Offline

 

#5 2021-11-30 20:46:47

Redletter20
Member
2021-11-30
5

Re: Is there any way to view albums or tags as a virtual file system?

Aw that's a shame because that's what I'm trying to do primarily.

Basically imagine if the album you created using that plugin, showed up as if it were a folder on your computer, or a network share that could be accessed from any device with a file manager. That's what Im trying to accomplish. I figured Piwigo has the largest user base, and a long history of support so it would be the most likely to have something like this, or someone who knows how to pull it off.

I remember a few years ago reading about someone doing the same thing but for Google photos, it let you access all your "virtual" albums as if it were a WebDAV share.

Offline

 

#6 2021-11-30 20:59:52

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

I know there is a physical to virtual plugin, but I don't recall anything that does what you want to accomplish. 

I do see your use case though, as I've had the same request from my wife - "Can't you just give me a folder of 18th birthday pictures that I can use to grab what I want?"  (I've done this via the command line and searching iptc tags and them symlinking them into a folder, but much more involved and burdensome than a simple plugin - this also assume all your tags/etc are written to the image file itself via iptc or some other mechanism)

Offline

 

#7 2021-11-30 21:07:08

Redletter20
Member
2021-11-30
5

Re: Is there any way to view albums or tags as a virtual file system?

Interesting, I didn't realize that was doable. I'm still hoping I can find a plugin, but would you mind expanding on what you said about finding the tags and symlinking? That sounds like a possibility that I could likely just write a script to handle for me. Its not perfect, but it might get the job done for now.

Just for a little context. I am currently using Synology Photos, so accessing the DB manually to pull tag data is not super easy, and the photo DB is contained in the Systems Postgres DB so one wrong keystroke could take down my whole NAS. So that's why im likely migrating my Photo solution to something more open.

Offline

 

#8 2021-11-30 21:20:44

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

Are your images tagged within the files themselves (via IPTC)?


I basically used 'find' (for .jpg) and piped in to iptc then piped in to grep, then ln  (I know that's a simplistic explanation, sorry for that)

It's a hog, sloppy, and prone to all kinds of 'issues', but sufficed for me in a pinch - if I can find the script, I'll post.

Offline

 

#9 2021-11-30 21:28:33

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

jnashpiwigo wrote:

Are your images tagged within the files themselves (via IPTC)?


I basically used 'find' (for .jpg) and piped in to iptc then piped in to grep, then ln  (I know that's a simplistic explanation, sorry for that)

It's a hog, sloppy, and prone to all kinds of 'issues', but sufficed for me in a pinch - if I can find the script, I'll post.

Come to think of it (in searching for the script) - I decided that querying the DB was an easier (and more reliable) method.

Code:

use piwigo;
select b.path from (select image_id from piwigo_image_tag where tag_id = '246'
and image_id in (select image_id from piwigo_image_tag where tag_id = '178'))
t inner join piwigo_images b where t.image_id = b.id and b.date_creation >
'2018-09-01' group by t.image_id into outfile
"/tmp/results.txt";

(This query searched for two tag ID's [178 and then 246] as well as date created > 2018-09-01)

Then I parsed out the resulting txt file and symlinked each match

Offline

 

#10 2021-11-30 22:24:07

jnashpiwigo
Piwigo Team
2014-10-21
248

Re: Is there any way to view albums or tags as a virtual file system?

The old script - which was just getting a single tag, looked like this....  (use at your own risk, I only sometimes play a programmer on the Internets!)

Code:

#!/bin/bash

# INPUT IS DERIVED FROM:
# find DATADIR -iname "*.jpg" | xargs taggrep.sh

while [[ $# -gt 0 ]] ; do
        file="$1"
        shift
        if echo $(iptc $file) | grep -iq "TAGKEYWORD"; then
                lfile=$(basename "$file")
                printf "Linking $file to $lfile\n";
                ln -s $file $lfile
        fi
done

Offline

 

#11 2021-11-30 22:40:01

Redletter20
Member
2021-11-30
5

Re: Is there any way to view albums or tags as a virtual file system?

awesome, I appreciate that. Im going to play around with this and familiarize myself more with Piwigo.

Ill just make a duplicate of some of my pictures to test with so when I inevitably screw everything up...multiple times, I can just wipe it and try again until I find a workflow that works for me.


Im no programmer myself, just shell scripting so far, but I'm likely going to begin learning soon, and I'm considering taking this on as my first "real" project. to make a small program that can expose image tags as virtual directories.

Ultimately my goal is to be able to not just view these "virtual folders" but to be able to add to them as well, so something like inotify could monitor the folder and when an image gets added exif tools can automatically tag the image with the name of the folder, move the image to a permanent album in gallery and then automatically create a symlink back in the virtual directory.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact