Hi All
I am successfully using Jose Gonzalez’s Upload plugin in my CRUD forms to upload photos of garments.
But I need to create at least one 150x150 pixel thumbnail. I have added Florian Krämer’s Imagine plugin to my composer.json file.
I have added the following to the PhotosTable.php to the initialize method.
$this->addBehavior('Burzum/Imagine.Imagine');
And have the following code in the afterSave method.
$imageOperations = [
'thumbnail' => [
'height' => 600,
'width' => 200
],
];
$this->imagineObject->processImage('/files/photos/filename/DC00021.jpg',
'/files/photos/filename/thumb/DC00021.jpg',
[],
$imageOperations
);
But I get
Table “App\Model\Table\PhotosTable” is not associated with “imagineObject”
Any ideas? I’m assuming afterSave is the best place to do this?
Andy