Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to resize only big images? [snippet won't work]

Go to End

2 Posts   1092 Views


Community Member, 72 Posts

28 August 2011 at 1:05pm

i found this snippet but it won't work :/

so is there any other possibility to prevent correctly sized images being resized?

While using the searchfunction i found something about the gd functions. but i don't understand them :/

can someone help me?


Community Member, 545 Posts

29 September 2011 at 8:34am

If the images are sized correctly, you should be calling them form the template using $Image with no dot functions (.SetWidth etc). Now if you're unsure if you're users will provide correct images you can always create a new function that checks the image size and only resize if its bigger than a specific size.