Hello/Hi/Greetings,
How do I know what my directory name needed in running the Piwigo Import Tree script. I am a new user and
just installed recently on my Ubuntu home server.
Here is the information from the documentation:
directory =“my photos directory” is the full or relative Path Name to the top of the Album Tree.
My environment:
Piwigo 14.5.0 Check for upgrade
Installed on 2 August 2024, 1 week 4 days ago
Operating system: Linux
PHP: 8.3.6 (Show info) [2024-08-14 15:46:39]
MySQL: 8.0.39-0ubuntu0.24.04.1 [2024-08-14 15:46:39]
Graphics Library: External ImageMagick 6.9.12-98
Cache size N/A never calculated
Piwigo URL: http://
Offline
(note to others: talking of [extension by plg] Piwigo Import Tree here).
I don't use it myself, but from source code it looks like you specify the parent directory of the tree you want to import and from there it uses the directory names as album names. So if you specify
--directory=/home/user/Pictures
then all directories under /home/user/Pictures are imported as album names, e.g. /home/user/Pictures/dirname1 as dirname1, /home/user/Pictures/dirname2 as dirname2, /home/user/Pictures/dirname1/dirname3 as dirname1/dirname3 and so on.
It seems you can also cd into some directory e.g. /home/user/Pictures and specify
--directory=.
or any relative path thereof.
Offline
erAck,
Thanks for your reply. I thought that this would lead me to my fix. But not so far. I had interpreted the Directory to be the the Target Directory inside Piwigo. There are several terms in their documentation as I copied below. Its states the Path Name to the top of the Album Tree. I assume Album Tree is my Albums within Piwigo or the Target Directory. The pictures and Albums are stored in MySQL database. Not sure in my Ubuntu OS, using SQL that you refer to the actual file.
–directory=“my photos directory” is the full or relative Path Name to the top of the Album Tree. (If the top directory contains spaces, surround it in double quotes)
In my piwigo.conf file, I found the entry: DocumentRoot: /var/www/html/piwigo. I figured this is what I needed for the target directory. This did not work.
Going back to their documentation it states:'
Starting with a specified directory, this and all the sub-directories in the tree structure are written as albums in Piwigo with all their JPEG images and Descriptions. And then for Windows, Use “cd” to change to an appropriate directory
I made a folder at my root or C:\FamilyHome that has 2 sub folders containing my sample pictures to import to Piwigo. So I change to that Windows folder. See my sample script and its execution:
C:\FamilyHome>perl piwigo_import_tree.pl --base_url=http://marisfamily.ddns.net:3080/piwigo/ --user=DaleMaris --password=????????? --directory=FamilyHome
Can't stat FamilyHome: No such file or directory
at piwigo_import_tree.pl line 121.
I did cover up my password not to expose my password on this form. In the perl code at line 121I found the statement: find({wanted => \&add_to_piwigo, no_chdir => 1}, $album_dir);
I do not know perl and how to interpret this statement, but assume the variable $album_dir is what I do not have defined correctly. I wonder if the error message, "Can't stat" should be can't start?
I also noted If your Piwigo gallery is hosted on Piwigo.com, use settings: --directory="my photos directory"
That sure does not look like a path.
Appreciate any and all help. Thank You
Dale Maris
Offline
I nowhere wrote that --directory would be the target album name whatever, it specifies the source directory.
Offline
Sorry, you did not say it was the target, that is my assumptions from me reading the statement in the documentation. I did run my script with your suggestion and here is the results:
C:\FamilyHome>perl piwigo_import_tree.pl --base_url=http://marisfamily.ddns.net:3080/piwigo/ --user=DaleMaris --password=?????? --directory=/home/user/Pictures
Can't stat /home/user/Pictures: No such file or directory
at piwigo_import_tree.pl line 121.
Next, since my photo to load to Piwigo is located at C:FamilyHome I also tried, first --directory=FamilyHome which didn't work so tonight I used:
C:\FamilyHome>perl piwigo_import_tree.pl --base_url=http://marisfamily.ddns.net:3080/piwigo/ --user=DaleMaris --password=?????? --directory=/FamilyHome
album "" must be created
cannot open file "/.piwigo_import_tree.txt" for writing at piwigo_import_tree.pl line 515.
Thanks, I got through one more issue. I have an album at the root level named FamilyHome that I thought might be used for people to load pictures. I don't see and number for the "-–parent_album_id=NN" I used the Album name "FamilyHome" but that did not work.
Don't know how to determine the Parent Album ID?
erAck, I do appreciate your help. Dale
Here is the ink to my Piwigo website: http://marisfamily.ddns.net:3080/piwigo
Offline
So if you want to import directories and files under C:\FamilyHome then why do you specify --directory=/home/user/Pictures ?!? That makes absolutely no sense. If your current directory is C:\FamilyHome already then use --directory=. (a single dot).
On Windows by the way never specify anything like --directory=C:\FamilyHome that won't work as --directory handles only Unix paths and something like C:\FamilyHome would end up as album names instead.
For -–parent_album_id=NN, each album/category has a unique numeric ID apart from its name, which can be arbitrary and even duplicate. You can find IDs by browsing to the album, the URL will end in something like category/1 or category/2 in your case. Or being logged in as Admin browse to http://marisfamily.ddns.net:3080/piwigo/tools/ws.htm and go to pwg -> categories -> getAdminList and hit the INVOKE button (or INVOKE (new window) for a larger result window). The REST (xml) output indicates for each category an id="1" and so on value that you would use as parent_album_id.
Offline
Sorry I am so slow. Thank you for all your help. As you can see I have a lot to learn. I am an old Database Admin from the IBM mainframe days, so much of this is new to me.
Thanks Dale
Offline