Image Resizing Issue
Started by everfreecreative, Mar 26 2012 01:13 PM
6 replies to this topic
#1
Posted 26 March 2012 - 01:13 PM
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?
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?
#2
Posted 26 March 2012 - 02:19 PM
Can you post your PW template and CSS code?
#3
Posted 26 March 2012 - 07:42 PM
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).
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).
#4
Posted 27 March 2012 - 12:43 AM
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)
So it will get upscaled to 900px.
$nextImage = $image->getNext(); $prevImage = $image->getPrev(); $sizedImage = $image->size(900);
So it will get upscaled to 900px.
@somartist | modules created | support me, flattr my work flattr.com
#5
Posted 27 March 2012 - 01:13 AM
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













