Web based family history software

file Question Problems with media 2.1

  • jackduckworth
  • jackduckworth's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 4 days ago #1 by jackduckworth
Problems with media 2.1 was created by jackduckworth
I have uploaded some scans to webtrees, and I can see them on the site, and in the data/media directory.

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.

More
1 week 4 days ago - 1 week 4 days ago #2 by Franz Frese
Replied by Franz Frese on topic Problems with media 2.1
when you have created media objects for all your files (images), then you can no longer create a media object.
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!
Last edit: 1 week 4 days ago by Franz Frese.

Please Log in or Create an account to join the conversation.

  • jackduckworth
  • jackduckworth's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 4 days ago #3 by jackduckworth
Replied by jackduckworth on topic Problems with media 2.1
Thanks, it looks like I misunderstood how files are assigned to media objects.

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.

More
1 week 4 days ago - 1 week 4 days ago #4 by Franz Frese
Replied by Franz Frese on topic Problems with media 2.1
first have a look at your setup for Media folders Media folder . there you can see, where your uploded files should appear.

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.

 
Last edit: 1 week 4 days ago by Franz Frese.

Please Log in or Create an account to join the conversation.

  • jackduckworth
  • jackduckworth's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 4 days ago #5 by jackduckworth
Replied by jackduckworth on topic Problems with media 2.1
Yeah, data/cache is empty, and I think it always has been. Apart from a couple of weirdly-named directories.

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.

More
1 week 4 days ago - 1 week 4 days ago #6 by Franz Frese
Replied by Franz Frese on topic Problems with media 2.1
no, only after it is shown.
the upload goes to the media folder .

I suppose when you remove the cache dir, it will be recreated with the correct access rights.
Last edit: 1 week 4 days ago by Franz Frese.

Please Log in or Create an account to join the conversation.

More
1 week 3 days ago #7 by fisharebest
Replied by fisharebest on topic Problems with media 2.1
> The error message is something like "x-thumbnail-exception: ImagickException: negative or zero image size `' @ error/image.c/CloneImage/794"

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
  • jackduckworth's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 3 days ago #8 by jackduckworth
Replied by jackduckworth on topic Problems with media 2.1

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:
Code:
$image = $this->imageManager()->make($filesystem->readStream($path));

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.

More
1 week 2 days ago #9 by fisharebest
Replied by fisharebest on topic Problems with media 2.1
To check if it is a problem with ImageMagick, try switching to GD.

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
  • jackduckworth's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 week 1 day ago #10 by jackduckworth
Replied by jackduckworth on topic Problems with media 2.1
Yes: GD works!

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.

Powered by Kunena Forum