Search…

X3 Photo Gallery Support Forums

Search…
 
aran4649
Topic Author
Posts: 6
Joined: 30 Dec 2021, 03:02

Thank you for such a great script (and happy new year!)

30 Dec 2021, 18:57

I want to thank you for such a great script.
I've tried for years to make sense of my photo collection and thanks to you I got it all solved in less than a day. It's magic!

Since you are deep in development, I have a few suggestions to make. None are really deal-breakers for me, but maybe they could provide some inspiration?

- Default timezone: since my server is not in the same timezone as myself, all the photo times are off (by 8 hours). It could be possible to figure out the actual timezone for each photo by checking GPS coords inside them (where present), but it sounds like a lot of work for a detail. Could you have a default timezone in the options instead? Like that most times would be correct, at least for the photos taken locally.

-Public folder: for most of my uses, having a guest login is probably overkill. Still, it would be nice ro grant full upload rights available to everyone JUST FOR ONE FOLDER. This would let my friends to share their photos easily while keeping the rest of the server safe.

-Default grid size: it's already possible to set the default display type between list, grid and so on. Could it be possible to preset grid size too (equivalent to having the UI slider already moved)?

-GPX preview: I'm using your script to record my hikes. So far, I'm just saving a GPX record file inside their folders, for local download. But it would be great to have them displayed in the browser too. It could be done quickly the leaflet.js library or a simple link to gpx.studio and would be a great addition for all hikers using the script

-Local CDN caching: admittedly making this a single file script was a huge selling point for me, and I thank you for the headaches it must have caused you. Still, relying on CDN downloads for core components casts a shadow for the the future. This will be my own photo album and I might want to keep it for the next 10 or even 20 years, who knows of all downloads will be available then? Is it technically possible to have an option for all CDN libraries to be stored locally too, so that they can still be accessed if their online counterparts fail later?

And that's all. Thanks again for this amazing script: it was magical to see my old photos back to life and I wish you all the best for 2022!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Thank you for such a great script (and happy new year!)

31 Dec 2021, 00:12

Hi, thanks for feedback!
aran4649 wrote:- Default timezone: since my server is not in the same timezone as myself, all the photo times are off (by 8 hours). It could be possible to figure out the actual timezone for each photo by checking GPS coords inside them (where present), but it sounds like a lot of work for a detail. Could you have a default timezone in the options instead? Like that most times would be correct, at least for the photos taken locally.
Interesting :thinking: Files on your server have "modified time" and that number is simply converted to date. I suppose it's possible to read timezone of server and then create offsets based on browser(user) timezone. This wouldn't be logical with photos where DateTimeOriginal is stored in the image (from camera EXIF) though ... If a photo is taken on 03. Jan 2021 at 15:40:21, that time is atomic and shouldn't be affected by timezones obviously. As for checking GPS coordinates where one has to consider all global timezones vs browser timezone vs server time, seems dodgy ... Besides, images that have GPS coordinates should normally contain EXIF DateTimeOriginal? I don't see any scenario where a photo's own DateTimeOriginal should be offset based on browser timezone ...
aran4649 wrote:-Public folder: for most of my uses, having a guest login is probably overkill. Still, it would be nice ro grant full upload rights available to everyone JUST FOR ONE FOLDER. This would let my friends to share their photos easily while keeping the rest of the server safe.
Indeed :ok_hand: This is definitely on the agenda, but first we need to implement a proper multi-USER system with permissions so that file manager features can be assigned per user. With multi-user, you would also be able to assign user-'ROOT', which means each user can see and access a different root folder. As for assigning different permissions for different folders per-user (as you are requesting), I must admit that's a big challenge. This means we need to store folder paths inside user configs, which means things will break if you rename folders on server. Optionally, we can store permission-configs inside each folder, although my aim for Files app is primarily to remain passive without adding app-files into user's directories.
aran4649 wrote:-Default grid size: it's already possible to set the default display type between list, grid and so on. Could it be possible to preset grid size too (equivalent to having the UI slider already moved)?
It's actually possible already with custom CSS. I might keep these options in CSS, because 1. the option itself is pure CSS, and 2. I don't want to start adding hundreds of minor cosmetic options into the core PHP config. Just create an empty file _files/css/custom.css, and add this:
Code
#files {
  --grid-size: 200px;
}
Keep in mind, grid will "snap" to available browser width so the above is just the "target" width.
aran4649 wrote:-GPX preview: I'm using your script to record my hikes. So far, I'm just saving a GPX record file inside their folders, for local download. But it would be great to have them displayed in the browser too. It could be done quickly the leaflet.js library or a simple link to gpx.studio and would be a great addition for all hikers using the script
That could be an interesting plugin. I found a demo of how it could look:
http://mpetazzoni.github.io/leaflet-gpx/

In Files app, when user clicks a GPX file, it would then open some modal/popup displaying a map similar as the above.
aran4649 wrote:-Local CDN caching: admittedly making this a single file script was a huge selling point for me, and I thank you for the headaches it must have caused you. Still, relying on CDN downloads for core components casts a shadow for the the future. This will be my own photo album and I might want to keep it for the next 10 or even 20 years, who knows of all downloads will be available then? Is it technically possible to have an option for all CDN libraries to be stored locally too, so that they can still be accessed if their online counterparts fail later?
Yes it's possible and I believe it's already requested. This of course means you will need to install Files app with required JS/CSS assets folders, and it won't then be "portable" like a single-file app. It also means that when you want to update Files app, you will need to update the assets also (which would be included in the "full" download package). Not too complicated for persistent Files app installations ...

As for CDN, personally I don't see much problems. We use jsdelivr.com, and like with other public CDN services (like Google and Cloudflare), they never went down, never go down and I don't see that they ever will. In addition, they provide faster loading resources to your visitors than your own server ever will.

Ok thanks!
 
aran4649
Topic Author
Posts: 6
Joined: 30 Dec 2021, 03:02

Re: Thank you for such a great script (and happy new year!)

04 Jan 2022, 00:31

Hi  mjau-mjau

Thanks a lot for the quick reply!

> If a photo is taken on 03. Jan 2021 at 15:40:21, that time is atomic and shouldn't be affected by timezones obviously.

There must be something strange going on, because the script is adding 8 hours to all my date stamps.
Take this picture here http://mytrails.xyz/?uploads#pid=PXL_20 ... 258.MP.jpg
The Exif correctly says 31/12/2021 at 15:52 but the script displays Fri, Dec 31, 2021 11:52 PM instead
It does look like a rogue time conversion, but I can't understand where the +8 hours come from, since the server is on the Paris timezone (-8 with my JST) and the value doesn't change with the client (I checked with a few web proxies)

> This means we need to store folder paths inside user configs
That would be great for me: one line in the config where I can say "FOLDER: /uploads/ RIGHTS: upload, delete Who: everyone". I don't even plan to use logins at all, I would just like for the current management UI to be available, but just for that one folder

> It's actually possible already with custom CSS.

Makes perfect sense, thank you!

> That could be an interesting plugin

Great! I actually built upon that very same script for my old website. Here is the code if it can help http://mytrails.xyz/?uploads#index.php

> Yes it's possible and I believe it's already requested.

Ok. More of a "nice to have" feature for me, but glad to know that it's being considered

Thanks again, Alain
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Thank you for such a great script (and happy new year!)

04 Jan 2022, 05:31

aran4649 wrote:There must be something strange going on, because the script is adding 8 hours to all my date stamps.
Take this picture here http://mytrails.xyz/?uploads#pid=PXL_20 ... 258.MP.jpg
The Exif correctly says 31/12/2021 at 15:52 but the script displays Fri, Dec 31, 2021 11:52 PM instead
It does look like a rogue time conversion, but I can't understand where the +8 hours come from, since the server is on the Paris timezone (-8 with my JST) and the value doesn't change with the client (I checked with a few web proxies)
Yea, that is kinda strange ... I did some research on the image, trying with this tool:
http://exif.regex.info/exif.cgi
exif.regex.info wrote:December 31, 2021 3:52:38PM (timezone not specified)
(4 days, 3 hours, 9 minutes, 56 seconds ago, assuming image timezone of 9 hours ahead of GMT)
But then there are also three other tags which specify a timezone +9 hours:
Create Date 2021:12:31 15:52:38.258+09:00
4 days, 3 hours, 9 minutes, 56 seconds ago
Date/Time Original 2021:12:31 15:52:38.258+09:00
4 days, 3 hours, 9 minutes, 56 seconds ago
Modify Date 2021:12:31 15:52:38.258+09:00
4 days, 3 hours, 9 minutes, 56 seconds ago
I also downloaded and checked on my Mac, and can se some similar values:
Image
I'm actually not quite sure what's going on here, but it seems Javascript is offsetting the photo-time based on viewer (client/browser) timezone :thinking: I'll look into it ...
aran4649 wrote:> This means we need to store folder paths inside user configs
That would be great for me: one line in the config where I can say "FOLDER: /uploads/ RIGHTS: upload, delete Who: everyone". I don't even plan to use logins at all, I would just like for the current management UI to be available, but just for that one folder
Right :thinking: In your case, you wouldn't then need "Who: everyone", since that would be explicit without users/logins. Anyway, I need figure out how to implement this.

Just wondering, in your case you have many folders that should be VIEWABLE but then only one folder /uploads/ where all users can upload and delete? As a workaround, you could add Files app index.php directly into /uploads/ dir and allow upload and delete, in which case you would have two urls, one for viewing from root (including subdir /uploads/) and one "admin" for uploading/deleting in the /uploads/ dir.
 
aran4649
Topic Author
Posts: 6
Joined: 30 Dec 2021, 03:02

Re: Thank you for such a great script (and happy new year!)

04 Jan 2022, 23:11

Thanks again for the kind help as usual!

> As a workaround, you could add Files app index.php directly into /uploads/ dir and allow upload and delete

One note about this: there might be an issue with the code that makes uploads fail if the script is installed in a subdirectory.

You can see it happening here: if you take the script, save it in a subfolder of a webdomain and edit the config to allow file uploads, every time you try to upload a file it will fail with "invalid path".

Editing the config to include the absolute path from server root doesn't seem to help either. For some reason, the script only seems to upload correctly when placed on a webhosting root folder.

I don't exclude I might be doing something wrong, but it seemed worth mentioning
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Thank you for such a great script (and happy new year!)

05 Jan 2022, 01:08

aran4649 wrote:One note about this: there might be an issue with the code that makes uploads fail if the script is installed in a subdirectory.
This is actually a separate bug when attempting to upload to the root folder. As you can see, I uploaded an image inside the /New folder/ directory in your uploads. This will be resolved shortly, but in the meantime, you can do this: Open index.php, locate around line 1310:
Code
$path = valid_root_path(post('path'), $is_dir);
Change to:
Code
$path = valid_root_path(post('path')?:'', $is_dir);
 
aran4649
Topic Author
Posts: 6
Joined: 30 Dec 2021, 03:02

Re: Thank you for such a great script (and happy new year!)

05 Jan 2022, 01:25

Perfect, thanks again!