[wp-trac] [WordPress Trac] #60628: Issues with avif image imagecreatefromavif not working. Resizing not possible.

WordPress Trac noreply at wordpress.org
Thu Jun 6 16:31:16 UTC 2024


#60628: Issues with avif image  imagecreatefromavif not working. Resizing not
possible.
-----------------------------------------------+---------------------------
 Reporter:  neo2k23                            |       Owner:
                                               |  adamsilverstein
     Type:  defect (bug)                       |      Status:  assigned
 Priority:  normal                             |   Milestone:  Awaiting
                                               |  Review
Component:  Media                              |     Version:  6.5
 Severity:  normal                             |  Resolution:
 Keywords:  needs-patch needs-unit-tests avif  |     Focuses:
-----------------------------------------------+---------------------------

Comment (by skithund):

 Replying to [comment:9 adamsilverstein]:
 > To start, a unit test should be able to reproduce the issue with the
 sample images.

 I'm not familiar with WordPress unit tests, but attached is a unit test I
 put together and it fails when ran with a broken PHP installation (eg.
 Ubuntu 23.04 default PHP 8.1).

 Working:
 {{{
 $ vendor/bin/phpunit --filter Tests_Image_Functions::test_php_avif_support
 Installing...
 Running as single site... To run multisite, use -c
 tests/phpunit/multisite.xml
 Not running ajax tests. To execute these, use --group ajax.
 Not running ms-files tests. To execute these, use --group ms-files.
 Not running external-http tests. To execute these, use --group external-
 http.
 PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

 Warning:       Your XML configuration validates against a deprecated
 schema.
 Suggestion:    Migrate your XML configuration using "--migrate-
 configuration"!

 .                                                                   1 / 1
 (100%)

 Time: 00:00.206, Memory: 177.00 MB

 OK (1 test, 2 assertions)
 }}}

 With broken PHP/GD:
 {{{
 $ vendor/bin/phpunit --filter Tests_Image_Functions::test_php_avif_support
 Installing...
 Running as single site... To run multisite, use -c
 tests/phpunit/multisite.xml
 Not running ajax tests. To execute these, use --group ajax.
 Not running ms-files tests. To execute these, use --group ms-files.
 Not running external-http tests. To execute these, use --group external-
 http.
 PHPUnit 9.6.19 by Sebastian Bergmann and contributors.

 Warning:       Your XML configuration validates against a deprecated
 schema.
 Suggestion:    Migrate your XML configuration using "--migrate-
 configuration"!

 F                                                                   1 / 1
 (100%)

 Time: 00:00.220, Memory: 195.00 MB

 There was 1 failure:

 1) Tests_Image_Functions::test_php_avif_support
 filesize( '/tmp/php-gd.avif' ) should be greater than 0 bytes.
 Failed asserting that 0 is greater than 0.

 /app/tests/phpunit/tests/image/functions.php:1177

 FAILURES!
 Tests: 1, Assertions: 2, Failures: 1.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60628#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list