Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
create thumbs when uploading image
class ImageCreateThumbs extends WireData implements Module {
public static function getModuleInfo() {
return array(
'title' => 'ImageCreateThumbs',
'version' => 100,
'summary' => '',
'href' => '',
'singular' => true,
'autoload' => true
public function init() {
$this->addHookAfter('InputfieldFile::fileAdded', $this, 'sizeImage');
public function sizeImage($event) {
$inputfield = $event->object;
if($inputfield->name != 'images') return;
$image = $event->argumentsByName("pagefile");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.