public static function thumbnail($source, $destination, $maxwidth = 150, $maxheight = 150, $scale = true) { if (file_exists($destination)) { return true; } $img = new self(); $img->createfromfile($source); $img->resize($maxwidth, $maxheight, $scale); $img->interlace(); $ret = $img->save($destination); $img->close(); return $ret; }