Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Gallery image question


Go to End


1285 Views

Avatar
BlueO

Community Member, 52 Posts

10 July 2010 at 9:52pm

Hello,

I'm having a few problems with the gallery module, specifically image manipulations on my homepage.

I can happily create a thumbnail of a GalleryPage's $DefaultIcon by including $DefaultIcon.PaddedImage(200, 200) in the template.

But I want to change the background colour of the PaddedResize so included this function in the HomePage_Controller :

 
public function generateLatestResize($gd) {
      return $gd->PaddedResize(600,400, $backgroundColor = "000000");   
		}

Now my issue is that $DefaultIcon.LatestResize doesn't return an image. Can anyone help me figure out what I'm doing wrong?
I've tried including the function in other classes that extend Image or GalleryPage_Image but no joy.

cheers

Bernard