Jonathan Lahijani Posted February 21, 2023 Share Posted February 21, 2023 I have a field that uses the Files fieldtype. Images and videos are being uploaded to it. Because it is not an Image fieldtype, I can't get an image width or height. I believe there is a way with the Pageimages class, but I'm a bit rusty on how to do this. There was a post on here that discussed how to do it but I can't find it. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Robin S Posted February 22, 2023 Share Posted February 22, 2023 This post maybe? 2 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted February 22, 2023 Author Share Posted February 22, 2023 Thanks. To get the width and height of an image, I'm doing this: // within repeater loop that has a file field called 'project_file' $imageSizer = new ImageSizer($project_file->filename); $width = $imageSizer->getWidth(); $height = $imageSizer->getHeight(); 3 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