This Help forum is for issues relates to the latest release (1.7.9). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: [SOLVED] Media errors related to function imagecreatefromjp

Media errors related to function imagecreatefromjp 4 months 1 week ago #1

  • latoga
  • latoga's Avatar
  • Offline
  • New
  • Posts: 5
All,

I just ran across a strange set of related errors. Specific error message seen is within AJAX calls and all relate to the function:
/<INSTALL_DIR>/app/Media.php:199 Call to undefined function Fisharebest\Webtrees\imagecreatefromjpeg()

This error comes up when:
  • Viewing Media Objects lists (see attached screen shot)
  • paging thru media in control pannels/manage media (see attached screen shot)
  • viewing recently uploaded file linked to an individual

I just started happening after uploading a new photo:
  • 1.9M jpeg file (php upload limit set to 20M). I also have uploaded files larger than this, but that was in the past under PhpGedView, before migrating site to webtrees; so this is the first file this size uploaded directly via webtrees.
  • filename: Joe-Carol-Lato-20180623_small.jpg

The error thrown when paging thru the manage media seems to happen on the page that contains the newly uploaded file...

Once errors occurred, I deleted the file from the family page where I uploaded it, but reference to the file still seems to be stuck in the system and causing issues. I can see the reference to the file in the media objects list report but can't act on it at all.

Where I need help:
  1. How do I delete the details about this file that are stuck in the system?
  2. Any ideas what could have triggered this issue to begin with (so I don't repeat the steps and run into again...or so the corner case can be fixed)?

System Specs:
  • Ubuntu 16.04.4 LTS (GNU/Linux 4.15.13-x86_64-linode106 x86_64)
  • PHP 7.0.30-0ubuntu0.16.04.1
  • webtrees v1.7.9

Appreciate the help!

Greg
Attachments:
---
Greg A. Lato
Lato / Sobolewski Family Tree Lead
familytree.latoga.com/
Last Edit: 4 months 1 week ago by latoga. Reason: added additional details.
The administrator has disabled public write access.

Media errors related to function imagecreatefromjp 4 months 1 week ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10500
The function imagecreatefromjpeg() is a PHP function, and is provided by the php-gd library.

During installation, webtrees checks that gd2 is installed. Perhaps there is an issue with this library?

You could try re-installing it. With ubuntu, you'd probably need to run something like:

sudo apt-get remove php-gd
sudo apt-get install php-gd
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Media errors related to function imagecreatefromjp 4 months 1 week ago #3

  • latoga
  • latoga's Avatar
  • Offline
  • New
  • Posts: 5
fisharebest,

Thanks for the pointer. The source of the problem appears to have been that gd2 wasn't installed. (not sure how webtrees installed without gd2 being there...)

The error was blocking the creation of thumbnails and then preventing the page from loading completely or the AJAX call from completing. Maybe the team can add some better error handeling around the call the imagecreatefromjp call to error out more gracefully?

Running the apg-get remove and install you provided and then restarting apache2 fixed the problem.

Thanks!

Greg
---
Greg A. Lato
Lato / Sobolewski Family Tree Lead
familytree.latoga.com/
The administrator has disabled public write access.

[SOLVED] Media errors related to function imagecreatefromjp 4 months 1 week ago #4

  • latoga
  • latoga's Avatar
  • Offline
  • New
  • Posts: 5
Problem solved.
---
Greg A. Lato
Lato / Sobolewski Family Tree Lead
familytree.latoga.com/
The administrator has disabled public write access.

[SOLVED] Media errors related to function imagecreatefromjp 4 months 1 week ago #5

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10500
webtrees checks for the GD library (and other server parameters) when it is first installed.

Often, a sysadmin will upgrade PHP (e.g. delete PHP 7.0 and install PHP 7.1), but forget to install the new versions of all the old libaries. This has the same effect as deleting a library/module.

> Maybe the team can add some better error handeling around the call the imagecreatefromjp call to error out more gracefully?

The next version of webtrees will require PHP 7.0 - which provides much better error handling.
We can now catch a wider range of errors, and have better tools to display them.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum