kylegilman / video-embed-thumbnail-generator

A WordPress plugin that generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
http://wordpress.org/plugins/video-embed-thumbnail-generator/
GNU General Public License v2.0
48 stars 27 forks source link

Problem creating Video Thumbnails #526

Open tante opened 1 year ago

tante commented 1 year ago

We run Wordpress 6.3 with PHP 7.4.3-4ubuntu2.19.

There's an issue when trying to set a thumbnail. I can generate them (I get 4 suggestions from the video) but when trying to save them I get an "Internal Server Error".

The logs show:

[Tue Aug 22 13:18:00.804074 2023] [php7:error] [pid 144111] [client 80.82.201.37:56447] PHP Fatal error:  Uncaught Error: Call to a member function get_size() on bool in PATH_TO_WORDPRESS/wp-content/plugins/video-embed-thumbnail-generator-4.8.11/src/admin/videopack-admin-ajax.php:398
Stack trace:
#0 PATH_TO_WORDPRESS/wp-includes/class-wp-hook.php(310): kgvid_ajax_save_html5_thumb()
#1 PATH_TO_WORDPRESS/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#2 PATH_TO_WORDPRESS/wp-includes/plugin.php(517): WP_Hook->do_action()
#3 PATH_TO_WORDPRESS/wp-admin/admin-ajax.php(188): do_action()
#4 {main}
thrown in PATH_TO_WORDPRESS/wp-content/plugins/video-embed-thumbnail-generator-4.8.11/src/admin/videopack-admin-ajax.php on line 398, referer: https://MYSITE/wp-admin/upload.php?item=7252

The problem seems to be in line 385: $editor = kgvid_decode_base64_png( $raw_png, $tmp_posterpath );

This does not seem to return an object.

kylegilman commented 1 year ago

Are you getting any specific errors in the Developer Console in your browser? It sounds like something is stopping the thumbnail from uploading to your server from your browser.

tante commented 1 year ago

Only the error that gets propagated from the backend upon trying to set one of the 4 generated images as thumbnail: Bildschirmfoto 2023-08-22 um 13 42 57

tante commented 1 year ago

Tested with a different browser (first was Chrome, now Firefox): Same problem. Looks like it's an issue server side? But other uploads (like uploading images or videos to the media library) work without problems.

tante commented 1 year ago

I have the same issue when setting an already existing image from the media gallery btw.

kylegilman commented 1 year ago

Ok, I can see where my bad error handling is causing a problem, but I can't tell exactly why the error is being generated. My best guess is it comes from PHP not having direct write access to the WordPress Media Library uploads folder. Have you made any changes to the location of the uploads folder?

tante commented 1 year ago

Nope, the Uploads folder is standard and the webserver has all rights to put things there (uploads in general work)