image width being ignored or overridden in repeater

I have this very straightforward code in my template:
<repeater>
<img src="<$imagesrc link='true'$>" width="120" align="left" border="0">
</repeater>

but my images come out specified to be width="85" (which they used to be).

I know the template is using the new code -- just to test I changed border to "12" and sure enough I got fat borders, but still 85 wide images. Just doesn't make sense.

any ideas?

BThies BThies, 7 years ago

From testing it myself, the <$imagesrc$> tag overrides any "width=" or "height=" you place within the <img> tag with the actual width and height of the original image.  Thus, your image will always be the original size.

I did, however, use the style tag in <img src="<$imagesrc link='true'$>" style="width:120px">, and it worked.  Unfortunately, the image's height did not change, so the ratio made it look stretched.  Also, the width style is not supported in some email clients (Notes & Outlook '07 I believe..), so it's not really a great solution.

It'd be nice if the system was coded to use <img src="<$imagesrc width='120' link='true'$>" and replace the image's width with '120' and leave the height blank (that way the email client would resize to keep the ratio correct).

Brian


Brian Thies
Professional Email Developer
Thies Publishing
Mathew Mathew, 7 years ago

OK, the editor will resize downwards to make your images match the width (and proportionally change the height), but if the images uploaded are less wide than the template specifies, they are left unchanged.

This is because upsizing images often looks much worse, and it is the way a lot of people asked us to handle images.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
Luc Pestille Luc Pestille, 7 years ago

It would be nice if the editor could crop images to the height specified (if it is) in the <img> tag too - I've got a template that needs specific sized images (I know, but I didn't design it), and the only way I can not break the layout is to get those images resized to that specific size before they're put into the email...

ahiaruhe, 7 years ago

So can someone (Mathew?) tell me how to specify a maximum width for an image within a repeater? It's a bit much to expect a client to re-size images before inserting them ... :-)  Cheers

go4 go4, 7 years ago
Mathew :

OK, the editor will resize downwards to make your images match the width (and proportionally change the height)...

Can you please clarify for me whether the editor actually resizes the image as it's uploaded or just adds width= to the html while still loading/sending the full size image scaled down?


www.go4.com.au | WordPress & Campaign Monitor services
go4 go4, 7 years ago
go4 :
Mathew :

OK, the editor will resize downwards to make your images match the width (and proportionally change the height)...

Can you please clarify for me whether the editor actually resizes the image as it's uploaded or just adds width= to the html while still loading/sending the full size image scaled down?

FYI - the editor DOES resize the image as it's being uploaded.


www.go4.com.au | WordPress & Campaign Monitor services
tobystokes, 6 years ago

Hi Matthew, or otherCM'er!
It would be good if you could clarify this from your documentation:

Required Attribute width=""
Any images wider than the specified width that are uploaded in its place will automatically be proportionally resized to the value set. Images narrower than specified will not be resized at all.

It does appear that if you upload an image smaller than the width specified in the template, CM will not generate an upscaled image. However, as the width attribute is still at the template-specified size in the rendered html, browsers will rescale the image to match, thus still displaying a larger image?

davidaf davidaf, 6 years ago

tobystokes,

The rendered HTML will actually state the actual width of the uploaded image if it is smaller than the originally defined width in the template - so browsers will not artificially blow up the image.


The Campaign Monitor Blog – HTML email smarts to go with your good looks

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098