2864 Posts in 732 Topics by 700 members
Template Questions
SilverStripe Forums » Template Questions » How to resize only big images ?
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba
|
Page:
1
|
Go to End | |
| Author | Topic: | 1914 Views |
-
How to resize only big images ?

21 December 2008 at 1:37am
Hi,
In my template, I show an image on the top of the page. The images have differents sizes. I want to resize image only if the image is bigger than 450px width or 250px height. For the moment, I'm using :
<% $Photo.SetWidth(450) %>
where Photo is an ImageFieldThe problem with this is that if the image is smaller it resize it bigger (poor quality) and if the image is vertical the resize's image is too big.
an issue ?
Thank's. Julien C.
-
Re: How to resize only big images ?

22 December 2008 at 2:10am
Ok,
but I don't know where to use it. I have to change Image.php (model) ?
Julien.
-
Re: How to resize only big images ?

22 December 2008 at 3:03am
I have found an example : http://doc.silverstripe.com/doku.php?id=recipes:customising_image
Thank's. Julien
| 1914 Views | ||
|
Page:
1
|
Go to Top |


