Forum

Thread tagged as: Problem

Specifying width in image tag but not resizing

Hey,

I've just realised I have a lot of excessively large images on my new site, and it appears to be because I'm not getting the re-sized version from Perch.

I have various templates which specify width of the image but the page is loading the original. This is from a 'project' page in Perch where I'm creating all the details and adding the images.

<perch:content type="image" id="list-image-imac" label="List Image iMac" width="900" bucket="Work" suppress="true" />

Oddly it does show the correct re-sized values in the admin: https://f.cl.ly/items/3a2Z410s262U0V43051I/Screen%20Shot%202015-03-17%20at%2016.01.23.png

Any ideas?

Richard Wiggins

Richard Wiggins 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using the same attributes when you output the image? What does the tag look like in that instance?

Perch finds the image file based on ID, bucket, width, height and crop settings.

Sorry for the slow reply, hadn't turned email notifications on.

I wasn't so my bad. I previously wasn't referencing the width:

<img src="<perch:content id="list-image-imac" />" alt="<perch:content id="title" />" />

I am now but this isn't updating the list image, even after removing the image and re-adding/saving.

<img src="<perch:content id="list-image-imac" width-"900" type="image" />" alt="<perch:content id="title" />" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

width-"900" should be width="900"

facepalm - sorry.

Laughing and swearing at myself right now.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No problem - I wish they were all that easy!