Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Images Show Up Compressed

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

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

Page: 1 2
Go to End
Author Topic: 109395 Views
  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Images Show Up Compressed Link to this post

    It could be that when you inserted the image in the content area the image resized to 600px to fit the TinyMCE Window?

    What happens when you insert the image if you enter 642px in the width box? Does it still resize it

    Also as a note to stop SS reducing quality in images you can set the global quality in your mysite/_config.php file by adding this line

    // Make all images nice and fancy
    GD::set_default_quality(100);

    By default its about 75 I think so this will increase load times and CPU work that needs to be done therefore it will use more PHP Memory as well so if you are on a slow shared host I wouldnt recommend it! but it will give you crisper images

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Images Show Up Compressed Link to this post

    Ok the plot thickens.

    I run my own server with multiple websites. I have an older client site running 2.2.2 rc3, and uploaded said image I'm testing into that site to test out. Uploaded through that website, it works perfectly and no major quality loss. Only some cause the setting is at 90, but it works as should. Odd.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Images Show Up Compressed Link to this post

    willr,

    Does setting the GD quality in the config file make it slower than setting it in the gd.php file? I'm assuming no, and you just mean the memory issue is caused by having higher quality image, just want to be positive.

    As for the resized image, as soon as I click the thumbnail image in tiny_mce preview, it maxes out the value at 600px. I can resize it to the proper dimensions before inserting it, and it loads fine in the content area, but this isn't very convenient for clients. Shouldn't be a problem for this site, but in general I'm curious.

    *Edit* Just put it in the config, and error was thrown saying called to undefined method. Is this even a setting or did you type it wrong?

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Images Show Up Compressed Link to this post

    I dont think Ive typed it wrong? what version of SS you using?

    GD::set_default_quality() calls the function set_default_quality() in the GD class (GD.php) so if you open GD.php (its in sapphire/filesystem?) I think it was renamed from setQuality() to set_default_quality() so try setQuality()

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Images Show Up Compressed Link to this post

    I'm using 2.2.2, latest version not trunk. Downloaded off website.

    In gd.php it has it as setQuality()

    I changed the line to GD::setQuality(90); in the config, but am given this error: "Using $this when not in object context", when I try to load the page.

  • Willr
    Avatar
    Forum Moderator
    5464 Posts

    Re: Images Show Up Compressed Link to this post

    sorry I am getting myself confused you cant call setQuality as its not static... set_default_quality() is not on 2.2.2 its on trunk sorry for confusing you! Theres no way to globally set it in 2.2.2.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: Images Show Up Compressed Link to this post

    lol I was going to say...

    That makes sense. No worries. Glad to see the setting is coming in the future though, as that'll help the upgrade process.

    Now if I can just find out why on this one website with 2.2.2, the image is being compressed, yet on the exact same server with 2.2.2rc3 it's not. It's driving me crazy...

    Oh well, thanks for the help. If anybody has any other suggestions, that would be great but I have a feeling I'm stuck.

  • Anatol
    Avatar
    126 Posts

    Re: Images Show Up Compressed Link to this post

    Hi,

    I found it actually unnecessary that images are resampled even if I did not resize them in the WYSIWYG editor (which I usually never do). There is a 3-line-hack that forces Silverstripe to use the original image if it was not resized. See here: http://silverstripe.com/site-builders-forum/flat/9740#post12044

    If you already created content with images you need to add the images again in the WYSIWYG to make these pages work.

    Cheers!
    Anatol

    109395 Views
Page: 1 2
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.