Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Image driver error in PHP8.1 with 1.9 Develop?
  • Hi,

    I'm upgrading some projects to 8.1, so Im using Fuelphp 1.9Develop.

    Most things are working fine, but I'm getting a probably bug in the image driver(core/classes/image/driver.php), specifically in the _resize function, which I use a lot in my projects.

    When I try to use this function (with the gd driver, but I suppose that with others I will get the same error) I get the following error:

    "substr(): Passing null to parameter #1 ($string) of type string is deprecated"

    The error jumps on the next line (line 255):

    "elseif (substr($height, -1) == '%' and $width == null)"

    Am I using the wrong function or is it a driver problem?

    Note: I use the function only with the first parameter, eg: $img->load(...)->resize($size)->save(...);


    Thanks a lot

  • I'll have a look.
  • Thanks harro,

    At the moment, to avoid the error, I have changed that line for this one:

    elseif ($width == null && $height !== null && substr($height, -1) == '%')

    it works for me
  • I have pushed a fix for it.
  • Thanks a lot Harro 

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion