php / php-src

The PHP Interpreter
https://www.php.net
Other
38.22k stars 7.75k forks source link

imagescale returns false with mode IMG_BICUBIC_FIXED or IMG_BICUBIC #12012

Closed wvell closed 1 year ago

wvell commented 1 year ago

Description

The following code:

<?php
$gd = imagecreate(32, 32);
$resized = imagescale($gd, 32, 32, IMG_BICUBIC_FIXED);
var_dump($resized);

Resulted in this output:

bool(false)

But I expected this output instead:

A valid GdImage object.

This seems only to happen on my mac. My linux machine does not have this issue. This also happens on multiple php versions (8.0, 8.1 and 8.2.9)

PHP Version

PHP 8.2.9 (cli) (built: Aug 16 2023 21:06:19) (NTS)

Operating System

MacOs Ventura (13.4.1) Chip Apple M1 Max

orlitzky commented 1 year ago

It's broken with an external copy of GD because IMG_BICUBIC was accidentally removed: https://github.com/libgd/libgd/issues/847

wvell commented 1 year ago

Thank you for the fast reply. I'll close this as this is not a php issue then.