]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Images.php
Photo delete is moved as well
[friendica.git] / src / Util / Images.php
index 3b07aee2fca1399e35bc6a994ed3459d70b2ce46..8a810510f0489916363b98e1d397e430b602a9e0 100644 (file)
@@ -185,14 +185,15 @@ class Images
                }
 
                if (Network::isLocalLink($url) && ($data = Photo::getResourceData($url))) {
-                       $photo = Photo::getPhoto($data['guid'], $data['scale']);
+                       $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::httpRequest()->fetch($url, 4);
+                       $img_str = DI::httpClient()->fetch($url, 4);
                }
 
                if (!$img_str) {