thetuningspoon Posted March 26, 2012 Share Posted March 26, 2012 I'm trying to set a max-width of 300px on the image field for images uploaded on the backend. However, when I try uploading a 900px wide image, I just get the image at the original width with greater pixelation. It's not being resized in the browser with html or css, since when I download the image it's still 900px wide. What's going on? Link to comment Share on other sites More sharing options...
Marty Walker Posted March 26, 2012 Share Posted March 26, 2012 Can you post your PW template and CSS code? Link to comment Share on other sites More sharing options...
thetuningspoon Posted March 27, 2012 Author Share Posted March 27, 2012 I'm using this gallery template file: http://processwire.c...__fromsearch__1 The CSS definitely isn't the problem, as I downloaded the image to check it out and it is, indeed, 900px wide (but looks like a 300px image blown up to 900px wide). Link to comment Share on other sites More sharing options...
Soma Posted March 27, 2012 Share Posted March 27, 2012 if you set the image to be max width 300px (it will scale bigger picture uploaded to 300px), then in the template there's (form that code) $nextImage = $image->getNext(); $prevImage = $image->getPrev(); $sizedImage = $image->size(900); So it will get upscaled to 900px. 1 Link to comment Share on other sites More sharing options...
Pete Posted March 27, 2012 Share Posted March 27, 2012 Yup - you need to check in your template what size the image already is using $image->width() and $image->height() if you don't want things to be blown up by the $image->size() code in the template. Link to comment Share on other sites More sharing options...
diogo Posted March 27, 2012 Share Posted March 27, 2012 would be very nice to have a max-size(900) Link to comment Share on other sites More sharing options...
thetuningspoon Posted March 27, 2012 Author Share Posted March 27, 2012 Whoops, that should have been an easy one to spot. Thanks guys! 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