]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
doc/themes.md,FAQ-admin: point to live friendica-themes.com mirror
[friendica.git] / src / Model / Photo.php
index 8ba01e33655d280ede203d5f774e3c6b51465a42..74171bd7bdde6f7ee2f9feb2a06838c7ee5f070d 100644 (file)
@@ -32,6 +32,8 @@ use Friendica\Core\Storage\Exception\InvalidClassStorageException;
 use Friendica\Core\Storage\Exception\ReferenceStorageException;
 use Friendica\Core\Storage\Exception\StorageException;
 use Friendica\Core\Storage\Type\SystemResource;
+use Friendica\Network\HTTPClient\Client\HttpClient;
+use Friendica\Network\HTTPClient\Client\HttpClientOptions;
 use Friendica\Object\Image;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Images;
@@ -497,7 +499,8 @@ class Photo
 
                $filename = basename($image_url);
                if (!empty($image_url)) {
-                       $ret = DI::httpClient()->get($image_url);
+                       $ret = DI::httpClient()->get($image_url, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_IMAGE]);
+                       Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
                        $img_str = $ret->getBody();
                        $type = $ret->getContentType();
                } else {
@@ -912,7 +915,8 @@ class Photo
        {
                $filename = basename($image_url);
                if (!empty($image_url)) {
-                       $ret = DI::httpClient()->get($image_url);
+                       $ret = DI::httpClient()->get($image_url, [HttpClientOptions::ACCEPT_CONTENT => HttpClient::ACCEPT_IMAGE]);
+                       Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
                        $img_str = $ret->getBody();
                        $type = $ret->getContentType();
                } else {