Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Auto-resized images - quality?

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2312 Views
  • superautomatic
    Avatar
    Community Member
    53 Posts

    Auto-resized images - quality? Link to this post

    When using the .SetWidth() function on images from a template, is there any way to control the resampling quality? It seems to me that the resampled image is kind of blurred.

    Here's an example: http://gvac2.web.pin.se/troll-c/

    (click the image to see the original version of the image)

    regards,

    /Jens

  • jam13
    Avatar
    121 Posts

    Re: Auto-resized images - quality? Link to this post

    There are two ways of fixing this that I know of at the moment:

    1) Edit sapphire/filesystem/GD.php and change the default quality from 75 to something higher (I find 90 works well). This will change the default quality for _all_ processed images. Of course this will get changed back when you upgrade SS.

    2) Extend or decorate the Image class and use the setQuality method to change the quality of generated images. If you're inserting images into the content area of a page then you will need to decorate the Image class, while if you doing a relationship then can just extend it.

    It would be much nicer to have an easier way of setting the quality though, even if it was just a constant in _config.php, as this is the most common complaint we have received from our customers.

    Of course there may already be an easy way of doing this, but if there is then it's certainly well hidden .

  • superautomatic
    Avatar
    Community Member
    53 Posts

    Re: Auto-resized images - quality? Link to this post

    Thanks for the quick answer. Worked perfectly.

    2312 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.