use Friendica\DI;
use Friendica\Model\Photo;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
+use Friendica\Object\Image;
/**
* Image utilities
/**
* Gets info array from given URL, cached data has priority
*
- * @param string $url URL
+ * @param string $url
* @return array Info
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
/**
* Gets info from URL uncached
*
- * @param string $url URL
+ * @param string $url
* @return array Info array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
}
if ($data) {
+ $image = new Image($img_str);
+
+ if ($image->isValid()) {
+ $data['blurhash'] = $image->getBlurHash();
+ }
+
$data['size'] = $filesize;
}
- return $data ?? [];
+ return is_array($data) ? $data : [];
}
/**