+ } catch (\Exception $exception) {
+ Logger::notice('Error fetching url', ['url' => $url, 'exception' => $exception]);
+ return [];
+ }
+ $fields = ['mimetype' => $curlResult->getHeader('Content-Type')[0]];
+
+ $img_str = $curlResult->getBody();
+ $image = new Image($img_str, Images::getMimeTypeByData($img_str));
+ if ($image->isValid()) {
+ $fields['mimetype'] = $image->getType();
+ $fields['width'] = $image->getWidth();
+ $fields['height'] = $image->getHeight();
+ $fields['blurhash'] = $image->getBlurHash();