I'm creating an image editor in JS/PHP, but now I'm having trouble. First of all, I load the image from the database (load a blob with imagecreatefromstring). Then I apply a list of actions to this image. But how can I get the image size from this image handler I have then? Without writing it to a file or use a stream object. How??
相关问题
- 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?
I doubt you can since php gd image object is a generic object, without considerations on the compression that will be used for storage (png/jpg/bmp ...)
In case you mean the image dimensions:
See
imagesx()
andimagesy()
.If you mean filesize, that's not possible without converting the GD resource to some image format (GIF, PNG, JPEG) because the format determines the image size in bytes.