- Posts: 6
Question
Problems with media 2.1
- jackduckworth
-
Topic Author
- Offline
- New Member
-
However I cant see them when I try to add media to another record: there is no "A file on the server" option in the dropdown.
They also show up as "Unused Files" under Control Panel/Manage Media.
Following a workaround here I removed "media/" from the preferences for the tree.
That almost works:
As you can see the first letter of the directory is missing. So it wont actually let me select a file.
Reverting the workaround means I lose the ability to select "A file on the server" again. (Although they do now appear under "Local files" in "Manage Media".)
URL: family.18ballymac.com
My setup is: I'm using a LAMP server. Because it already had PHP 8.2 on it I installed webtrees 2.1.22
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
So this possibility is missing.
But you can reuse a created media object. Instead of clicking onto the + , click into the empty field and enter some arbitray text from the name of the media object.
If you have time lateron I can explain where yours thoughts go wrong.
ps.: there is a trick to create a new object, even if all files are already connected to a media object.
pps.: may be a look into a german manual heps for handling media objects . Use a translator perhaps. If you are missing something there: ask!
Please Log in or Create an account to join the conversation.
- jackduckworth
-
Topic Author
- Offline
- New Member
-
- Posts: 6
I still dont understand the distinction between Local Files and Unused Files, or why the "A file on your server" option disappears and re-appears, but I do at least know one way to upload a file and associate with a media object, and that's perfectly fine.
The reason I thought this was important is that I thought it was behind another issue I'm having - thumbnails are all showing up with a "500" box.
I understand that this is because ImageMagick is failing to create a thumbnail at runtime. The error message is something like "x-thumbnail-exception: ImagickException: negative or zero image size `' @ error/image.c/CloneImage/794"
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
the thumbnails are created below <webtrees dir/>data/cache .
"Unused Files" lists those on the server, where you can create a media object from.
why the "A file on your server" option disappears and re-appears? there is no file on your server you can create a mediaobject from. All files are used within media objects.
Please Log in or Create an account to join the conversation.
- jackduckworth
-
Topic Author
- Offline
- New Member
-
- Posts: 6
www-data@debianMiniPC:~/webtrees$ find data/cache/
data/cache/
data/cache/@
data/cache/@/K
data/cache/@/K/P
www-data@debianMiniPC:~/webtrees$ ls -lrt data/cache/\@/K/P/
total 0
www-data@debianMiniPC:~/webtrees$ ls -lart data/cache/\@/K/P/
total 8
drwxr-xr-x 3 www-data www-data 4096 Apr 10 17:40 ..
drwxr-xr-x 2 www-data www-data 4096 Apr 11 18:20 .
So, is it meant to populated when, or just after. a file is uploaded?
Please Log in or Create an account to join the conversation.
- Franz Frese
-
- Offline
- Platinum Member
-
the upload goes to the media folder .
I suppose when you remove the cache dir, it will be recreated with the correct access rights.
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
Is the corresponding media file zero size?
If not, perhaps there is a file-permission error that prevents it from being read?
BTW - error thumbnails (e.g. the red 500) are NEVER cached. Only successful thumbnails are cached. So you don't need to delete your cache to fix these.
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- jackduckworth
-
Topic Author
- Offline
- New Member
-
- Posts: 6
Is the corresponding media file zero size?
If not, perhaps there is a file-permission error that prevents it from being read?
No I dont think it's either of these: I've tried a selection of jpgs, all with the same results.
I've got as far as debugging the php to find the line that is throwing that error and it's this one, in app/Factories/ImageFactory.php:
I've checked that $filesystem can read the contents of $path, so it's something to do with ImageMagick.
(btw I'm using ImageMagick 6.9.11 and php 8.2.28.)
Please Log in or Create an account to join the conversation.
- fisharebest
-
- Offline
- Administrator
-
Look at app/Factories/ImageFactory. Swap the order of the two parts of function imageManager().
Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net
Please Log in or Create an account to join the conversation.
- jackduckworth
-
Topic Author
- Offline
- New Member
-
- Posts: 6
Thanks for that. I know GD performance is worse than Imagick, but I only have a handful of photos currently, so I can live with that.
I'm still determined to track down the Imagick issue, but it doesn't look like an issue with the webtrees code. (My guess is that one of the 3rd party libraries is missimg a dependency.)
Please Log in or Create an account to join the conversation.