mime_type, self::TYPES, true) || $media->getCustomProperty('metadata_stripped')) { return false; } $path = $media->getPath(); if (! is_file($path)) { return false; } try { Image::load($path)->quality(90)->save($path); } catch (Throwable $exception) { report($exception); return false; } clearstatcache(true, $path); $media->size = (int) filesize($path); $media->setCustomProperty('metadata_stripped', true); $media->saveQuietly(); return true; } }