-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AVIF support for getimagesize() and imagecreatefromstring()
Thanks to Joe Drago for help with the AVIF detection code. Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com> Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de> Closes GH-7091.
- Loading branch information
Showing
13 changed files
with
208 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--TEST-- | ||
imagecreatefromstring() - AVIF format | ||
--EXTENSIONS-- | ||
gd | ||
--SKIPIF-- | ||
<?php | ||
if (!(imagetypes() & IMG_AVIF)) { | ||
die('skip AVIF support required'); | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
echo "Reading image whose major brand is 'avif':\n"; | ||
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_major_brand.avif')); | ||
var_dump(imagesx($im)); | ||
var_dump(imagesy($im)); | ||
|
||
echo "Reading image with a compatible brand that's 'avif':\n"; | ||
$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring_compatible_brand.avif')); | ||
var_dump(imagesx($im)); | ||
var_dump(imagesy($im)); | ||
?> | ||
--EXPECT-- | ||
Reading image whose major brand is 'avif': | ||
int(250) | ||
int(375) | ||
Reading image with a compatible brand that's 'avif': | ||
int(480) | ||
int(270) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.