function saveThumbnail($imagePath, $width, $height) { $thumbPath = ListHelpers::getListThumbPathFromImage($imagePath); try { Image::make($imagePath)->fit($width, $height)->save($thumbPath); } catch (Intervention\Image\Exception\NotReadableException $e) { throw new Exception('Error saving thumbnail! Invalid image!'); } catch (Intervention\Image\Exception\NotWritableException $e) { throw new Exception('Error saving thumbnail! Permission issue! Contact site admin'); } }