claviska / claviska/SimpleImage

Fatal error: Uncaught TypeError: imagesx(): Argument #1 ($image) must be of type GdImage

Open
#341 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.4k
Forks
377
PR merge metrics
No merged PRs in 30d

Description

Hello, I got the following fatal err when converting some images with SimpleImage->bestFit().

Fatal error: Uncaught TypeError: imagesx(): Argument #1 ($image) must be of type GdImage, null given in D:\php\hvmenu\vendor\SimpleImage\SimpleImage.php on line 659 TypeError: imagesx(): Argument #1 ($image) must be of type GdImage, null given in D:\php\hvmenu\vendor\SimpleImage\SimpleImage.php on line 659 Call Stack: 0.0002 368272 1. {main}()

... claviska\SimpleImage->bestFit($maxWidth = 1920, $maxHeight = 1080)
... claviska\SimpleImage->getWidth()
SimpleImage.php:748 imagesx($image = NULL)
SimpleImage.php:659

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in SimpleImage.php at the imagesx() call reported on line 659 and the getWidth() call on line 748, then reproduce the failure through bestFit(). Trace why the image value is null for the affected input and define the expected handling; done means the conversion no longer produces this fatal TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.