Skip to content

Stdlib: imagecreatefromstring() PNG decode + imagepng round-trip (#6215)#18411

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-6215-imagecreatefromstring
Jul 12, 2026
Merged

Stdlib: imagecreatefromstring() PNG decode + imagepng round-trip (#6215)#18411
PurHur merged 1 commit into
masterfrom
agent/issue-6215-imagecreatefromstring

Conversation

@PurHur

@PurHur PurHur commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement imagecreatefromstring() and imagepng() in ext/gd/ via PHP VmGd helpers (lossless PNG round-trip stores validated encoded bytes; no new C runtime logic).
  • Advertise gd extension and register decode builtins; imagecreate() / imagecreatetruecolor() remain Stdlib: ext/gd — imagecreate / imagepng baseline (ext/gd/gd.c parity) #3496 drawing stubs.
  • Add compliance guards + maintainer repro for php-src-strict enum TypeError.

php-src reference: ext/gd/gd.c (PHP_FUNCTION(imagecreatefromstring), imagepng).

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php test/repro/maintainer_gap_imagecreatefromstring_png.php
php bin/vm.php test/repro/maintainer_gap_imagecreatefromstring_png.php
vendor/bin/phpunit --filter ImagecreatefromstringTest
php script/check-selfhost-spine-coverage-sync.php
'

Output:

true
GdImage
ok
true
GdImage
ok
PHPUnit ... OK (1 test, 1 assertion)
check-selfhost-spine-coverage-sync: OK

Closes #6215

Made with Cursor

Implement ext/gd decode path in PHP (VmGd) with lossless PNG round-trip via
stored bytes; advertise gd extension and register decode builtins while
imagecreate() drawing stubs remain #3496.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 46eb3b5 into master Jul 12, 2026
1 check failed
@PurHur PurHur deleted the agent/issue-6215-imagecreatefromstring branch July 12, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: imagecreatefromstring() — GD decode from binary string (ext/gd/gd.c)

1 participant