Announcement

#1 2011-12-09 18:21:19

RMM
Member
2011-12-09
23

Synchronizing with local file structure but creating thumbnails online

Hi

I used gallery2 before and after trying out a whole lot of galleries now I decided to switch to Piwigo. And now I'm having some questions :-).

- Is it somehow possible, that I can upload my pictures on the server, preserving directory structure, file names, and let piwigo create the thumbnails and "web sized photos".
I was traveling for several years and will leave again soon, so I usually do my uploads in internet cafes with quite old hardware. So I can't "afford" creating them locally (the worst thing I ever experienced, was an 486 with windows 98 and ie 4.0, 20 minutes and 3 blue screens later I gave up ;-)).
Since I have a dedicated server, computing power is not a problem once the pictures are uploaded.
I tried using the virtual albums and the web upload function, but since I used gallery2 not only for presenting the pictures but also as backup media for my pictures I can't use the virtual albums, since it is completely impossible to synchronize it with my local file structure like that.
So I thought ok, let's create a physical album and then use the web interface to upload pictures into it, so I don't have to create thumbnails and "web size photos" myself.
Unfortunately when you do that, the pictures don't get stored in the "physical" folder but in the upload folder. Would there be an easy way to change that?

- As far as I understood it's not possible to change the file structure to store the thumbnail and the "web size photos" at a different location. That's still true, right?
Would there be an easy way of writing a plugin which rebuild the directory structure of where you store the original pictures to store the scaled photos only in this folders? So only the base folder of the original pictures and the scaled pictures would be different and it wouldn't be necessary to use the "pwg_high" directory anymore.
If not, bad luck, I can live with that even it complicates the synchronizing process a whole lot. Or would the developping team accept patches which implements this functionallity (as an option) in the piwigo core (I don't have time to do it right now, but may be in the next few months or years ;-))?

- What about the part about beeing even more restrictrive than gallery2 about allowed characters in directory names (as they exist in almost every language with latin characters besides english,...).  I seems like there is still no clean solution to extend that without patching the core?

thanks a lot for any suggestions and answers :-)

ps. otherwise piwigo seems to be a great product :-)

edit: I'm using piwigo 2.3.1

Last edited by RMM (2011-12-09 18:37:08)

Offline

 

#2 2011-12-09 19:34:06

flop25
Piwigo Team
2006-07-06
7036

Re: Synchronizing with local file structure but creating thumbnails online

-"Unfortunately when you do that, the pictures don't get stored in the "physical" folder but in the upload folder. Would there be an easy way to change that?"
I wish the upload form can let the user chooses... but it's nor possible currently. I will need to upload via ftp, but there is FTP browser extension and easy to use ftp client


-there is
// prefix_thumbnail : string before filename. Thumbnail's prefix must only
// contain characters among : a to z (case insensitive), "-" or "_".
$conf['prefix_thumbnail'] = 'TN-';

// dir_thumbnail : directory where thumbnail reside.
$conf['dir_thumbnail'] = 'thumbnail';
but nothing for pwg_high : I think that should be easy to change.Can you open a ticket in the bugtracker please ? http://piwigo.org/bugs/

-that comes from the synchronizing script which was the base of everything initially... plg should answer to this mush better than me

thx


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2011-12-10 00:00:49

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13487

Re: Synchronizing with local file structure but creating thumbnails online

RMM wrote:

Is it somehow possible, that I can upload my pictures on the server, preserving directory structure, file names, and let piwigo create the thumbnails and "web sized photos".

This is not an official feature, but I would try the following:

1) use FTP to add photos in directory "galleries"

2) use screen [Administration > Tools > Thumbnails] to generate thumbnails

3) synchronize on [Administration > Tools > Synchronize]

4) use [Administration > Photos > Batch Manager] with action "resize web size photos". Original photos will be moved as HD and Piwigo will generate a smaller size for the "web size"


RMM wrote:

- As far as I understood it's not possible to change the file structure to store the thumbnail and the "web size photos" at a different location. That's still true, right?

[Bugtracker] ticket 1350

We don't have such a feature right now, and it's not an easy one I admit.

RMM wrote:

- What about the part about beeing even more restrictrive than gallery2 about allowed characters in directory names (as they exist in almost every language with latin characters besides english,...).  I seems like there is still no clean solution to extend that without patching the core?

Please read this recent topic [Forum, topic 18297] Read-only filesystem and centralized thumbnail creation

Offline

 

#4 2011-12-10 14:07:27

flop25
Piwigo Team
2006-07-06
7036

Re: Synchronizing with local file structure but creating thumbnails online

plg wrote:

RMM wrote:

- As far as I understood it's not possible to change the file structure to store the thumbnail and the "web size photos" at a different location. That's still true, right?

[Bugtracker] ticket 1350

We don't have such a feature right now, and it's not an easy one I admit.

Quite hard to change the directory structure like that... we just can easily add a config variable for the name of the pwg_high folder

plg wrote:

RMM wrote:

- What about the part about beeing even more restrictrive than gallery2 about allowed characters in directory names (as they exist in almost every language with latin characters besides english,...).  I seems like there is still no clean solution to extend that without patching the core?

Please read this recent topic [Forum, topic 18297] Read-only filesystem and centralized thumbnail creation

You proposal is great but on older post/ticket mathiasm said it might be not as simple as that... but I think it was before utf-8 so what's the situation now ?

Last edited by flop25 (2011-12-10 14:07:45)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2011-12-14 11:11:12

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

plg wrote:

This is not an official feature, but I would try the following:

1) use FTP to add photos in directory "galleries"

2) use screen [Administration > Tools > Thumbnails] to generate thumbnails

3) synchronize on [Administration > Tools > Synchronize]

4) use [Administration > Photos > Batch Manager] with action "resize web size photos". Original photos will be moved as HD and Piwigo will generate a smaller size for the "web size"

Thanks, that works like a charm :-).
Just one more question, would it also be possible, to add the files directly to pwg_high directory, and let him create thumbnails and websize fotos from there?
Because like that I would be able to write a little script which would create the directory structure inside of the galleries directory automatically based on an other directory structure with the original pictures and symlink the pwg_high directory to the corresponding directory with the original pictures.

plg wrote:

RMM wrote:

- As far as I understood it's not possible to change the file structure to store the thumbnail and the "web size photos" at a different location. That's still true, right?

[Bugtracker] ticket 1350

We don't have such a feature right now, and it's not an easy one I admit.

If it's that difficult to change the locations in the code, I guess an easier one could be like the one I descriped above with the symlinks?
You already have the synchronization feature, so now the only thing that would be missing, is an option to set the directory to which one piwigo should synchronize to.
Then when you are in the admin screen and do the "local synchronization" piwigo just looks in the specified directory, and recreates and symlinks it as described above and creates the thumbnails and websized pictures. If it can't create them from the pwg_high directory yet, I'm sure it should be quite easy to add this functionality. Once the pwg_high directory is symlinked and all the down sized pictures are created, piwigo can continue working as it's used to, none of the other intern logics need to be changed.
Like that the original directory structure even could be read-only, as wished in an other thread...

plg wrote:

RMM wrote:

- What about the part about beeing even more restrictrive than gallery2 about allowed characters in directory names (as they exist in almost every language with latin characters besides english,...).  I seems like there is still no clean solution to extend that without patching the core?

Please read this recent topic [Forum, topic 18297] Read-only filesystem and centralized thumbnail creation

I saw the topic before, but since you used subjunctive in your sentences, I guessed the configuration variable $conf['authorized_characters_in_files'] doesn't exist yet... (I also wasn't able to find it in the default configuration file).
And if somehow possible I don't want to patch the core files, because I already know that I will already have forgotten that I done that when I do the next update and will be cursing about people which are incapable of developping downward compatible updates ;-).

Offline

 

#6 2011-12-29 01:00:02

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

So, finally got some time left this evening.
I wrote a plugin which does exactly what I descriped above :-).
Synchronizes a directory with the piwigo galleries directory over symlinks, and automatically creates the thumbnails and websized images :-).
So after executing the plugin one can use the synchronization feature included in piwigo to add new files to the database :-).

- So one can import the files directly from the gallery2 file structure, and let the old gallery running if necessary.
- It's possible to have the images in read only directories
- It's a lot easier to synchronize the gallery with a local one
- and so on

Offline

 

#7 2011-12-29 13:20:47

flop25
Piwigo Team
2006-07-06
7036

Re: Synchronizing with local file structure but creating thumbnails online

hello
we are under planning a new way of displaying other sizes of pictures : read [Forum, post 126641 by plg in topic 18570] Multiple-size
with that new feature, we could implement though a plugin or in the core, a way to add extra folders of pictures : the thumbnails and other resized pictures would be generated in the new folder _data/i/

Last edited by flop25 (2011-12-29 13:21:01)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#8 2011-12-29 14:53:49

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13487

Re: Synchronizing with local file structure but creating thumbnails online

RMM wrote:

I wrote a plugin which does exactly what I descriped above :-).

What about distributing this plugin? With an "how to" for creating symlinks.

Offline

 

#9 2012-01-02 18:35:55

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

flop25 wrote:

we are under planning a new way of displaying other sizes of pictures : read [Forum, post 126641 by plg in topic 18570] Multiple-size
with that new feature, we could implement though a plugin or in the core, a way to add extra folders of pictures : the thumbnails and other resized pictures would be generated in the new folder _data/i/

sounds great :-). Until then I will use my way to do it...

plg wrote:

What about distributing this plugin? With an "how to" for creating symlinks.

The plug in creates the symlinks itself. You only need to specify a source path and a destination path (the piwigo gallery path). So no need to know anything about symlinks for the user.

The way it is like right now, you need to set all options as constants in a php file. I didn't implement any frontend, as soon as you click on the link in the admin/tool menu, the script will be executed directly and returns after a while (the first generation of a few 1000 thumbnails can take quite a while ;-)) "OK" in the browser.

I think like that it's not userfriendly enough to upload it into your plugin directory?

Will try to create a minimalistic frontend as soon as I have time to.

Offline

 

#10 2012-01-02 18:39:05

flop25
Piwigo Team
2006-07-06
7036

Re: Synchronizing with local file structure but creating thumbnails online

you can add to the subversion repository only or add it as a beta with no compatibility


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#11 2012-01-05 18:30:59

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

so, published it. usage at your own risk...
works for me as it is.
if anybody's interested in it: [extension by RMM] Synchronize local directory

I have to say that I won't improve it a lot (if at all), since as mentioned by flop25 the piwigo team is going to implement an equivalent functionality in piwigo anyway. So I don't see a lot of sense in investing a lot of work in a plugin which will be obsolete in a few months anyway.

Last edited by RMM (2012-01-05 18:32:12)

Offline

 

#12 2012-02-26 16:21:54

Richard
Guest

Re: Synchronizing with local file structure but creating thumbnails online

Hi,

the plugin is not running in 2.3.4 - what should i change to get it work?

richard

 

#13 2012-03-01 13:02:52

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

sorry for the late reply, but i´m traveling right now.
anyway. what do you mean by it does not work?
Did you execute the necesary steps descriped in the readme?


if they didn´t change their plans yet, then the upcoming version of piwigo (april?) should include changes, which will make my plugin obsolete...

Offline

 

#14 2012-03-01 21:27:13

Richard
Member
2012-03-01
9

Re: Synchronizing with local file structure but creating thumbnails online

Hi RMM,

thx for your reply.

i followed this step in the readme:

- adjust in synchronlizeLocaldirectory.php the variables "sync_source_dir" and "piwigo_gallery_dir"

activated the plugin and then i clicked on the "Synchronize local directory" link in the backend of my  piwigo installation. nothing happened.

Then i found out that i've used an old revision of this plugin:12844

Found this link: http://piwigo.org/svn/extensions/Synchr … directory/
Revision: 13453

I changed the settings again and now i got the following error right after my click on the new menu entry:

Warning: Cannot modify header information - headers already sent by (output started at /path/piwigo/Synchronize_local_directory/SynchronizeLocalDirectory.php:169) in /path/piwigo/include/page_header.php on line 103

then  a minimal "hello world " plugin appers

Line 103 in page_header.php: header('Content-Type: text/html; charset='.get_pwg_charset());

maybe it's my fault. if the error is too hard to find i have to wait for the upcoming version :-(

richard

Offline

 

#15 2012-03-27 18:16:41

RMM
Member
2011-12-09
23

Re: Synchronizing with local file structure but creating thumbnails online

hi richard

I'm really sorry for my slow replies but since I'm traveling I'm really having problems finding (usable) internet connections.
Unfortunately I'm using the piwigo packets provided by debian, and they didn't package 2.3.4 yet, so I'm unable to test it with this version.
But it seems like also other people are using this plugin (I got private messages) I will see if I can fix/check it in the near future (no promises).
And otherwise the release of the next piwigo version should be quite near :-).

Offline

 

Board footer

Powered by FluxBB

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