windracer wrote:
Also got a few of these during video thumbnail generation:
Code:
? Poster could not be processed – invalid or corrupt JPEG: ././galleries/people/amy/2021/2021-07/spain-abroad/2021-07-01 Trujillo (Jul 1 - Jul 2) and Salvatierra de Santiago/pwg_representative/capture-1625132571.006397.MP4.jpg
Ok, looks like the reason for this error is videos shorter than the default 4 seconds where VideoJS looks to grab the frame for the thumbnail. If I use Batch Manager, it automatically uses a different location:
Video ./galleries/people/amy/2021/2021-07/spain-abroad/2021-07-01 Trujillo (Jul 1 - Jul 2) and Salvatierra de Santiago/capture-1625132571.006397.MP4 — too short duration, poster produced at another position
But your plugin doesn't seem to do that and throws the error instead.
Also, related to video thumbnails. If I use VideoJS in Batch Manager, the thumbnails are created in the pwg_representative folder as <filename without extension>.jpg. But your plugin is creating them as <filename WITH extension>.jpg. As a result, I'm seeing duplicate video thumbnails in my pwg_representative folders like this:
- IMG_2888.jpg
- IMG_2888.MP4.jpg
- IMG_2987.jpg
- IMG_2987.MP4.jpg
- IMG_3020.jpg
- IMG_3020.MP4.jpg
The ones with the .MP4.jpg extension were created by your plugin, but I don't think Piwigo will "see" them due to the naming format. As a result, I suspect these are all unused duplicate images just taking up disk space.
Last edited by windracer (2025-06-08 22:46:19)
Offline
windracer wrote:
ran into this error:
Code:
"\u26d4 Invalid image dimensions in DB for ID 68536 (.\/galleries\/events\/sporting-events\/guardians\/IMG_2620.JPG) \u2013 width\/height missing"
Seems like this error was on a few HEIC files that had .JPG extensions. Even though the EXIF/metadata correctly showed the height/width, Piwigo was reporting it as empty. I had to "replace" the photos with actual .JPG versions and that resolved the issue with those.
Offline
Still getting errors when trying to generate thumbnails (on pre-existing photos, not newly synchronized ones). This one doesn't seem to actually have a description of what the problem is:
{"processed":1,"generated":1,"offset":1,"done":false,"total":161377,"log":["\ud83d\udd0d Scanning for missing thumbnails...","\ud83e\uddee Total thumbnails to generate: 161377",{"type":"progress","step":"thumbnail","index":1,"total":161377,"percent":0,"image_id":"3693","simulate":false,"path":".\/galleries\/places\/ohio\/brick DSC_04361.JPG","thumb_type":"thumb"}],"summary":""}
Fatal error: Uncaught mysqli_sql_exception: MySQL server has gone away in /usr/local/piwigo/include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /usr/local/piwigo/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()
#1 /usr/local/piwigo/include/functions_session.inc.php(161): pwg_query()
#2 /usr/local/piwigo/include/pwgsession.class.php(21): pwg_session_write()
#3 [internal function]: PwgSession->write()
#4 [internal function]: session_write_close()
#5 {main}
thrown in /usr/local/piwigo/include/dblayer/functions_mysqli.inc.php on line 132Offline
Hi Windracer,
Thanks so much again for testing and for your feedback!
I just released version 0.3.0 of AlbumPilot, see https://github.com/HendrikSchoettle/Alb … tag/v0.3.0 - which I believe addresses most of the points you raised:
There is now a dropdown-based album selector with live text filtering.
A new "parent element" at the top of the list lets you select all albums at once for recursive processing. This should cover your case where no root album was visible before.
The plugin now supports granular control over thumbnail and video poster generation, including the ability to overwrite existing thumbnails and configure generation intervals, sizes, formats, and more.
See the release notes for detailed information.
I wasn't able to test the "select all albums" feature thoroughly myself, as I currently only have a single album in my test gallery - so I'd really appreciate if you could verify that it now behaves as expected on your end.
Regarding the error messages and processing failures you encountered: I've seen similar behavior myself, especially when testing on large galleries. In my cases, the root cause turned out to be corrupt or partially uploaded media files. The plugin's logic tries to detect this, and I would recommend double-checking those specific files using Piwigo's standard tools (or regenerating them, if possible). If the issue also appears in standard Piwigo operations, it's very likely a media-specific problem. If not, please let me know.
Still, if you continue to see consistent plugin-specific errors, feel free to share logs or reproduce steps, I'll do my best to look into them even though I can't promise fast turnaround times.
@All: Please test this version on different environments and report feedback, bugs, and compatibility notes.
From my side, this version is now feature-complete and feels "final", at least for now (yes, I know, famous last words...). Anyway, it includes all the functionality I originally had in mind.
If I get some positive feedback and a bit more confirmation from others that it's stable across various setups, I'd be happy to promote it to version 1.0.0 and submit it to the official Piwigo plugin directory. Since the plugin touches several central parts of the database architecture, I want to make sure it's been tested by more than just me before publishing it as an official version.
Thanks again for your time and effort. I really hope this plugin makes life easier!
Best,
Hendrik
Offline
Ran into a problem with 0.3.0. It looks like something changed with regards to the album_pilot_settings table. In my current Piwigo databases, the table is named piwigo_album_pilot_settings which I now realize is wrong since it's not using my table prefix of pwg_. The new version of the plugin seems to be looking for pwg_album_pilot_settings which then fails because the table does not exist:
Fatal error: Uncaught mysqli_sql_exception: Table 'piwigo-beta.pwg_album_pilot_settings' doesn't exist in /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /usr/local/piwigo-beta/plugins/AlbumPilot/admin.php(587): pwg_query() #2 /usr/local/piwigo-beta/admin/plugin.php(53): include_once('...') #3 /usr/local/piwigo-beta/admin.php(406): include('...') #4 {main} thrown in /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php on line 132I renamed the table (via phpMyAdmin) and that let me see the UI again, but with a huge block of code above it, which seems wrong.
I found an album_pilot.log file in the plugin directory, but it's empty.
I'll keep poking at it. If you want me to submit an issue in Github, let me know.
Last edited by windracer (2025-06-11 14:30:21)
Offline
Hey, thanks again for testing - and sorry I didn't mention the table change more clearly!
In version 0.3.0, the plugin finally uses Piwigo's table prefix properly. That means the settings table is now named something like pwg_album_pilot_settings instead of just album_pilot_settings, so the plugin won't find the old one anymore, which causes that error.
Easiest fix: just delete the old table entirely. It only stores UI settings (like checkbox states and the selected album), nothing critical - so there's really no data loss.
Normally, the plugin will recreate the table automatically on first run. If that doesn't happen, you can rename maintain.class.php.disabled back to maintain.class.php. Make sure the plugin folder is named exactly AlbumPilot (according to your screenshot, you did).
That way, the table will be created cleanly via the install hook when activating the plugin.
One side note: I intentionally made the plugin "folder-name agnostic" so I can rename the folder whenever I update it. That helps avoid issues with old JS or CSS files being cached and causing weird bugs after installing new versions. So if you run into any UI glitches, you can try just renaming the plugin folder to something like AlbumPilot-030 and reloading - that often fixed things in my case. Just note that if the folder is renamed, the install/uninstall logic in maintain.class.php has to be disabled, as you will not be able to activate/deactivate the plugin in that case. I am not sure whether this will change the broken header output you are seeing, but maybe you can give it a try.
Hope that helps! Let me know if anything's still broken.
Best,
Hendrik
Offline
I apparently have messed something up. After deleting the table, when I tried to activate the plugin I just got "an error occured" in a red text bubble above it. I tried renaming maintain.class.php.disabled to just maintain.class.php but the same problem occured (the table was not being created).
I ended up using your SQL in maintain.class.php to manually create the table. I was then able to activate the plugin again. But I'm still getting the wall of code before the plugin UI (in my screenshot above) when going into the plugin settings.
Offline
Okay, can you send me the code that's visible in the beginning of the web page? If possible, just the entire html content (Ctrl - U in the browser, you may remove any internal text) and maybe any related logfile entries? Thanks! The code usually appears in case of errors thrown prior to the creation of the HTML body. Thanks!
Offline
I sent you a PM, thanks!
Offline
I went back to v0.2.1 and it worked, so seems to be something specific to v0.3.0?
Offline
Hi Windracer,
Thanks for the information you sent over in the PM and the further testing. I still haven’t been able to reproduce the missing-table error on my end, so I’m not entirely sure which leftover tables might exist in your database. Here’s a quick summary of how the table logic changed between 0.2.1 and 0.3.0 and what to try next:
Version 0.2.1
On activation the plugin always created an unprefixed album_pilot_settings table so any old settings got replaced automatically.
There was no maintain.class.php installer script and everything ran directly from the admin file.
Version 0.3.0 and now 0.3.1 (see below)
We now respect Piwigo’s table prefix (for example pwg_) and look only for pwg_album_pilot_settings.
The install and uninstall routines moved into maintain.class.php, which ships as maintain.class.php.disabled by default to avoid unexpected reinstalls when renaming the plugin folder.
Because of that change, if the new table isn’t present (and maintain.class.php is still disabled), the plugin probably throws an SQL exception and dumps raw PHP code above the UI.
Please try these steps:
In phpMyAdmin run
SHOW TABLES LIKE '%albumpilot%';
and note every table name that appears.
For each result, execute
DROP TABLE table_name;
replacing table_name with the table name.
Now, to recreate the correct table:
Rename
maintain.class.php.disabled
to
maintain.class.php
Deactivate and then activate AlbumPilot in Piwigo’s plugin manager.
Open the plugin settings page, this runs the install hook and creates pwg_album_pilot_settings.
If you plan to rename the plugin folder afterward (to force a fresh JS/CSS cache), first rename maintain.class.php back to maintain.class.php.disabled before renaming the folder; otherwise the plugin won’t start.
After that the plugin UI should hopefully load normally without dumping code at the top. Let me know which tables you found and whether this resolves the issue. Thanks again for your patience and thorough testing.
One more thing: plugin folder names with hyphens can also cause activation problems in Piwigo, since hyphens get converted to underscores internally. If you haven’t already, try renaming your plugin folder to something like AlbumPilot123 (no hyphens) to force a fresh cache of JS and CSS. Underlines and numbers work fine; hyphens tend to create unexpected errors. Clearing your browser cache helps too, but I found in Chrome you often still get stale files unless you change the folder name.
You don’t need to worry about multiple databases being created in case of renaming the plugin folder. Your settings table remains the same regardless of folder name. Just rename, deactivate, reactivate, and clear cache, and that hopefully covers both the missing-table issue and any hidden cache problems. Let me know.
BTW, I just released an update, v0.3.1 (see https://github.com/HendrikSchoettle/Alb … tag/v0.3.1), containing minor bugfixes - maybe you want to try that one.
Thanks!
Hendrik
Offline
I'm really confused as to what is happening here.
I removed 0.2.1 and deleted the piwigo_ prefixed album_pilot_settings table via phpMyAdmin (I'm no stranger to SQL databases so I'm comfortable with all of that). No other "orphaned" tables.
Downloaded and extracted 0.3.1, but just like with 0.3.0, no matter how I name the plugin folder (AlbumPilot, AlbumPilot_beta, etc.), with maintain.class.php present (so it will create the table), the plugin fails to activate with just "an error occured":
At this point, activating or deactivating the plugin throws the same error. The only way I can "remove" it is to rename the maintain file back to .disabled or physically remove the plugin folder from my server (and then try again). I cannot figure out the proper order of events to get the plugin to install, create the table, and then work. Basically, whenever that maintain file is not "disabled" the plugin will not activate.
Sorry for the trouble, but I'm assuming things like this will need to get worked out before you can put the plugin into the extension library.
Last edited by windracer (2025-06-13 14:34:49)
Offline
Ok, this seems to be a different issue. Please try to delete our rename maintain.class.php. That should again allow enabling/disabling the plugin. The table will be created by the plugin anyway, even without that file.
Offline
I deleted the file, but when activating the plug-in, it's not creating the table so I get the wall of PHP code and this error:
Fatal error: Uncaught mysqli_sql_exception: Table 'piwigo-beta.pwg_album_pilot_settings' doesn't exist in /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /usr/local/piwigo-beta/plugins/AlbumPilot_beta/admin.php(587): pwg_query() #2 /usr/local/piwigo-beta/admin/plugin.php(53): include_once('...') #3 /usr/local/piwigo-beta/admin.php(406): include('...') #4 {main} thrown in /usr/local/piwigo-beta/include/dblayer/functions_mysqli.inc.php on line 132Want me to try manually creating the table again?
Offline
Okay, let me check this again, I will work on an update and try to reproduce your error. This one definitely has to be fixed.
Offline