Jump to content

Image Resizing Issue


thetuningspoon
 Share

Recommended Posts

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

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.

  • Like 1
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...