public function getTypeFromExtensionAttribute()
{
$imageGenerators = $this->getImageGenerators()->map(function (string $className) {
return app($className);
});
foreach ($imageGenerators as $imageGenerator) {
if ($imageGenerator->canHandleExtension(strtolower($this->extension))) {
return $imageGenerator->getType();
}
}
return static::TYPE_OTHER;
}