X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FImages.php;h=077509d3cb5e6e1c64105e2a7886bd131cf31be5;hb=71cf72cc8bde161471b2294c675fb0500dd48399;hp=7b11ea3f6b580e57286d33beab41c04c409c6153;hpb=fccb72565115ce30e2981c7d96f11fe951e46bb4;p=friendica.git diff --git a/src/Util/Images.php b/src/Util/Images.php index 7b11ea3f6b..077509d3cb 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -1,6 +1,6 @@ fetch($url, 4); + if (Network::isLocalLink($url) && ($data = Photo::getResourceData($url))) { + $photo = Photo::selectFirst([], ['resource-id' => $data['guid'], 'scale' => $data['scale']]); + if (!empty($photo)) { + $img_str = Photo::getImageDataForPhoto($photo); + } + // @todo Possibly add a check for locally stored files + } + + if (empty($img_str)) { + $img_str = DI::httpClient()->fetch($url, 4); + } if (!$img_str) { return [];