0
Fixed

error when generating thumbnails

ochompsky 4 months ago updated by Vlad R 2 weeks ago 4

i noticed there are lots of random missing thumbnails on the site so i tried to run the script manually:

php -c /etc/php/7.4/apache2/php.ini make_thumbs.php

i get the following error:

PHP Fatal error: Uncaught Error: Call to a member function getWidth() on bool in /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php:40
Stack trace:
#0 /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php(87): FileRun\Thumbs\Make::needsProcessing()
#1 /var/www/html/system/modules/fileman/sections/cli/php/thumbs.php(118): FileRun\Thumbs\Make::make()
#2 /var/www/html/index.php(191): unknown()
#3 /var/www/html/cron/make_thumbs.php(8): unknown()
#4 {main}
thrown in /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php on line 40

Fatal error: Uncaught Error: Call to a member function getWidth() on bool in /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php:40
Stack trace:
#0 /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php(87): FileRun\Thumbs\Make::needsProcessing()
#1 /var/www/html/system/modules/fileman/sections/cli/php/thumbs.php(118): FileRun\Thumbs\Make::make()
#2 /var/www/html/index.php(191): unknown()
#3 /var/www/html/cron/make_thumbs.php(8): unknown()
#4 {main}
thrown in /var/www/html/system/classes/vendor/FileRun/Thumbs/Make.php on line 40

Under review

Right-click a file from the FileRun user interface, select the Control panel option under “More options”. You will find in there troubleshooting tools which will help you find out what happens behind the scene and where the problem might be. You can post here the output. The errors that you posted don't give enough information to understand what goes wrong.

Here is the output of thumbnail generation for the file the script failed on.  Presumably it throws that error when `checking image resolution.`

Debugging is on (1596539215)

Request options:

Array

(

[skipNotification] => 1

[caching] =>

[debug] => 1

)

In use options:

Array

(

[skipNotification] => 1

[caching] =>

[debug] => 1

[width] => 400

[height] => 400

[geometry] => contain

[pageNo] => 0

[forceExt] => png

)

Processing: /filerun/IMG_34667.png

As: png

File size: 81025 bytes (79 KB)

File is safe for web.

File is smaller than 8 MB.

Checking image resolution.

Started

It's probably a broken PNG file. By broken, can also mean a different file format, like JPG, but incorrectly renamed to PNG.
This situation will be handled better after the next FileRun update.