The G Posted July 25, 2023 Share Posted July 25, 2023 Hello! I am wondering if the mime type of a Pageimage exists somewhere in the object. The only ways I could think of for getting the mime type are using PHP GD functions getimagesize($img->filename)['mime'] or, to pass around integer constants rather than string variables image_type_to_mime_type(getimagesize($img->filename)[2]) or image_type_to_mime_type((new ImageSizer($img->filename))->getImageType()) although I don't see the point in instantiating an ImageSizer. Link to comment Share on other sites More sharing options...
BrendonKoz Posted July 25, 2023 Share Posted July 25, 2023 Once you have a PageImage object, you can use the getDebugInfo method and parse the return value to identify the mimetype. ? https://processwire.com/api/ref/pageimage/get-debug-info/ 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now