21496 Posts in 5784 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1866 Views |
-
Extending the GD Class

13 May 2009 at 4:52pm
Im still learning the ropes, but am really enjoying the flexiblity of Silverstripe, ive really tried to make use of what docs are available (although hard to find) to push the boundries of what i know. But this ones stumped me... I've found a very interesting PHP class that would add the exact functionality that i need to really push the GD class. Can anyone point me in the right direction, or add some pointers for including this class the correct silverstripe way? The class im wanting to include adds functionality such as blend modes and complex resizing etc.
I figured i should throw this out there to get some guidance before i dove in and broke something.
Cheers in advance.
-
Re: Extending the GD Class

14 May 2009 at 3:02pm Last edited: 14 May 2009 3:09pm
Can anyone point me in the right direction? im sure this would be of use to anyone who uses uploaded images on their silverstripe sites?
ive included the class and the Holder page im using it on. My thoughts are that its not returning what silverstripe expects. Does anyone know whats being returned after you run a generate***() image function, is it the image itself, or a class, or somethign else?
-
Re: Extending the GD Class

15 May 2009 at 12:10am
Well. It takes a bit more work to achieve what you want since S-stripe has the GD class wrapped which makes it easier to handle images with the SS framework.
I did not find an elegant method of doing this , so what I did was :
1> Get the image-location on disk of the Silverstripe image you'd like to process
2> Process the image with GD
3> Write the image to filesystem
4> Create a new Silverstripe_GD object to use in your template (To create a Silverstripe GD object, you can use
new GD(path/to/file) .....Good luck !
| 1866 Views | ||
|
Page:
1
|
Go to Top |


