Extract Image Dimensions from Base64 String

后端 未结 1 1378
自闭症患者
自闭症患者 2021-01-18 00:07

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)

相关标签:
1条回答
  • 2021-01-18 00:48

    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.

    0 讨论(0)
提交回复
热议问题