Jump to:

5554 Posts in 1742 Topics by 1227 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Image resampling for servers with low memory_limit [ss 2.3]

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

Page: 1
Go to End
Author Topic: 1280 Views
  • gieser
    Community Member
    13 Posts

    Image resampling for servers with low memory_limit [ss 2.3] Link to this post

    Hi guys,
    I recently ran into a problem with uncle cheeses image gallery. I want to migrate the website of my hockey club to silverstripe, but since our hosting provider runs php via fast cgi we can't use more than 32MB of memory (even if you try to set a higher memory limit).
    While searching for a work around I noticed, that imagemagick is installed on the server and i'm able to call the command line programms of this library (convert, etc.)
    Therefore I have rewritten the GD class to use cli calls instead of built-in gd functions. This is a lot faster and the memory usage of called programms does not count to the limit of PHP.

    I'll provide my class to you, but beware: it is not properly tested (just didn't have enough time), it won't check if you are able to use "exec". Also not every feature of the original GD class is implemented (e.g. paddedResize, which will call croppedResize instead).

    This is for silverstripe 2.3, I haven't checked if the GD class of 2.4 is compatible.

    Attached Files
  • Tonyair
    Community Member
    81 Posts

    Re: Image resampling for servers with low memory_limit [ss 2.3] Link to this post

    Hi, here's client size resizing swfupload module it'll be helpful for people who tries to upload photos directly from camera, 'cos when u're trying to upload photo more then 8Mb imagemagic will be pretty slow too.

    Thx, gieser with both of that solutions everything works really fast

    Attached Files
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.