Is there a relatively simple way (perhaps regular expressions?) of detecting the dimensions -height & width - of an image from a base64 string (and perhaps the filesize)? That is to say without actually creating an image resource?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- How to get the background from multiple images by
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
Decode the base64, and use
getimagesizefromstring()
.http://www.php.net/manual/en/function.getimagesizefromstring.php
This will be way more reliable than trying to write your own handling of each image type available.