Skip to content

Add safe wrapper for getimagesizefromstring#728

Open
spawnia wants to merge 2 commits intothecodingmachine:masterfrom
mll-lab:add-getimagesizefromstring
Open

Add safe wrapper for getimagesizefromstring#728
spawnia wants to merge 2 commits intothecodingmachine:masterfrom
mll-lab:add-getimagesizefromstring

Conversation

@spawnia
Copy link
Copy Markdown
Contributor

@spawnia spawnia commented Apr 14, 2026

The PHP documentation for getimagesizefromstring only says "See getimagesize" in its return values section, so the generator's regex patterns cannot detect that it returns false on failure. Added as a special case in lib/special_cases.php.

The function is identical to getimagesize (which is already wrapped) except it accepts image data as a string instead of a filename.

spawnia added 2 commits April 14, 2026 16:51
The PHP documentation for getimagesizefromstring only says
"See getimagesize" for return values, so the generator cannot
detect that it returns false on failure. Added as a special case.
- Use array<mixed> for $image_info parameter value type
- Mark channels and bits as optional in return type
@spawnia spawnia marked this pull request as ready for review April 14, 2026 15:00
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.

1 participant