I've been using on the fly GD Functions in my templates and that's great!
But now i need to use it inside my backend personal function and i don't know how to call it.
-------------------------
class Example extends ImageGalleryPage {
static $has_one = array(
'Picture' => 'ExampleThumb'
);
public function MyFunction() {
$query = DataObject::get("Example");
foreach($query as $object)
{
if ($object->PictureID)
{
$image = DataObject::get_by_id("File", $object->PictureID);
$display_url = $image->URL;
************************************************************
*** OK! How should i use GD Functions to change my image right now? ***
************************************************************
}
}
}
}
class ExampleThumb extends Image {
function generateGoodOne($gd) {
$gd->setQuality(100);
return $gd->resizeByWidth(150);
}
}
-------------------------