Content directed upload

griffinmt
griffinmt's picture

Joined: 2009-09-06
Posts: 128
Posted: Sat, 2009-10-03 18:03

Just thinking out load right now, but...
Would it be a reasonable capability, possibly in a future version, to have both the web uploads and Server add actions take information from the items being uploaded to 'construct' the album path that the item gets installed into?

For example, when a photo is uploaded, get the exif 'Date Picture Taken' info and construct a default destination target. For September 12, 2007 it would go into 2007/Sep 2007/ album. Possibly to do this would need a 'Auto/Manual' checkbox on the upload/add panel and a place to supply a plug-in that is passed the photo name and exif data array and returns a destination path, or blank for the default path. Reckognize this would have to deal with missing exif data, movies of various formats and so forth.

I don't want to open a ticket for this until there has been some usefull dialog on its use etc.

Martyn T. Griffin

 
brjhaverkamp

Joined: 2009-10-05
Posts: 1
Posted: Mon, 2009-10-05 14:40

I like the idea. But I want to go one step further.
I currently have a large directory structure with pictures that I manage with digikam (any other photo manager is also good)
I'd like to be able to have gallery3 take that directory and scan for changes. Any additions, deletions and changes to that directory, its subdirectories and files should then be reflected in the gallery.

If this is already possible, my appologies for a dub. I'm not aware of such a function however, and from experience, it is a very comon usecase.

Regards,

Bert

 
griffinmt
griffinmt's picture

Joined: 2009-09-06
Posts: 128
Posted: Mon, 2009-10-05 22:08

Where is the upload code controlled, and is there access by that point to the exif data array, filename, source path, etc.
Starting from there, it should be possible to 'selectively' add new entries (even delete them) and create the path structure as you go.

Martyn T. Griffin

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Mon, 2009-10-05 22:50

the upload code is in

modules/gallery/controllers/simple_uploader.php
function add_photos.

This function however has the gallery that the file is being uploaded into as a variable. So you can't really ammend this to add the functionality you want.

However, What you could do is create a new module. You can use a lot of the existing code thats in the simple_uploader... but instead of passing in a gallery you can create or use an existing gallery based on the exif information in the file that's just been uploaded. You'd probably have to find some code to read the exif information as well... but I'm pretty certain that exists somewhere in the g3 code too.

Bert - What your asking is not possible unless you install software on the client machine. A web page doesn't have that kind of access to your local filesystem.

Ben

Benjamin Albert Smith - Photography

 
griffinmt
griffinmt's picture

Joined: 2009-09-06
Posts: 128
Posted: Mon, 2009-10-05 22:58

1) Wouldn't the request by Bert be doable via an AJAX request, passing all the pertinent data of the source image?

2) in order to mod the simple_uploader (and Server_add), I would need access to the exif data. Would this already have been added to the database by then?

Martyn T. Griffin