Title: Fatal error in PHP
Last modified: March 29, 2021

---

# Fatal error in PHP

 *  [Knut Sparhell](https://wordpress.org/support/users/knutsp/)
 * (@knutsp)
 * [5 years ago](https://wordpress.org/support/topic/fatal-error-in-php-2/)
 * > `Uncaught TypeError: is_file(): Argument #1 ($filename) must be of type string,
   > GdImage given in /home/*/public_html/wp-content/plugins/auto-smart-thumbnails/
   > inc/class-ast-face-detector.php:63`
 * Occurred during loading of Customizer.
    -  This topic was modified 5 years ago by [Knut Sparhell](https://wordpress.org/support/users/knutsp/).
      Reason: Extra info

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [qiuliu](https://wordpress.org/support/users/qiuliu/)
 * (@qiuliu)
 * [5 years ago](https://wordpress.org/support/topic/fatal-error-in-php-2/#post-14250695)
 * Can you turn on debug log? Here is how:
    Check ‘Log debug info for troubleshooting’
   in ‘Settings -> Auto Smart Thumbnails’. Leave a note here what site url is having
   the problem.
 *  [jilfransoi](https://wordpress.org/support/users/jilfransoi/)
 * (@jilfransoi)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-in-php-2/#post-14667993)
 * I had the same bug, I was able to investigate and found a solution
 * The `is_ressource` function doesn’t return true anymore when you send it a gimage
   object in php8 ([reference here](https://php.watch/versions/8.0/gdimage))
    So
   the code fails a line 63 in class-ast-face-detector.php.
 * I was able to make it work by testing the value of get_class for the ressource:
 *     ```
               if (is_resource($file) || get_class($file) == 'GdImage') {
   
                   $this->canvas = $file;
   
               } elseif (is_file($file)) {
   
                   $this->canvas = imagecreatefromjpeg($file);
       ```
   
 * I am not sure if it is the best fix but it seems to work
    -  This reply was modified 4 years, 8 months ago by [jilfransoi](https://wordpress.org/support/users/jilfransoi/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Fatal error in PHP’ is closed to new replies.

 * ![](https://ps.w.org/auto-smart-thumbnails/assets/icon-256x256.jpg?rev=2219864)
 * [Auto Smart Thumbnails](https://wordpress.org/plugins/auto-smart-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/auto-smart-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/auto-smart-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/auto-smart-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/auto-smart-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/auto-smart-thumbnails/reviews/)

## Tags

 * [trouble-shoot](https://wordpress.org/support/topic-tag/trouble-shoot/)

 * 2 replies
 * 3 participants
 * Last reply from: [jilfransoi](https://wordpress.org/support/users/jilfransoi/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/fatal-error-in-php-2/#post-14667993)
 * Status: not resolved