sander_ha

but made an extension on Image

  1. public function GreyscaleImage()
  2. {
  3. return $this->generateGreyscaleImage($this->owner);
  4. }
  5.  
  6. public function generateGreyscaleImage(AssetContainer $image)
  7. {
  8. $variant = $image->variantName('GreyscaleImage');
  9.  
  10. $changedImage = $image->manipulateImage($variant, function (Image_Backend $backend) {
  11. $greyscaled = $backend->getImageResource()->greyscale();
  12. $backend->setImageResource($greyscaled);
  13.  
  14. return $backend;
  15. });
  16.  
  17. return $changedImage;
  18. }
sander_ha

Does anyone remember how to greyscale images in ss4? Using the Intervention library

sander_ha

Indeed.. Pretty sure it was still in ss3 when I needed it, so thats why i ended up using the SilverStripe RestfulServer one

sander_ha

silverstripes works quite nicely out of the box, but under the hood its kind of mess 😞

😂 (1) ✔️ (1)
sander_ha

Yes it looks like colymbas is a bit more structured

sander_ha

I guess one needs to use onAfterArchive or such

sander_ha

So appearently in SS3 onAfterDelete gets triggered on a Page when it is unpublished..