]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
File and category aren't using "term" anymore
[friendica.git] / src / Model / Photo.php
index 34fd37a9de52bf0cdcd6f21f41bbbb25ea56767a..9d8b5611f7f8b5f2543b0cc74e92521be7a6a0ba 100644 (file)
@@ -432,9 +432,7 @@ class Photo
                        return false;
                }
 
-               if (empty($type)) {
-                       $type = Images::guessType($image_url, true);
-               }
+               $type = Images::getMimeTypeByData($img_str, $image_url, $type);
 
                $Image = new Image($img_str, $type);
                if ($Image->isValid()) {
@@ -662,6 +660,12 @@ class Photo
                                'resource-id' => $image_rid, 'uid' => $uid
                        ];
                        if (!Photo::exists($condition)) {
+                               $photo = self::selectFirst(['allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'uid'], ['resource-id' => $image_rid]);
+                               if (!DBA::isResult($photo)) {
+                                       Logger::info('Image not found', ['resource-id' => $image_rid]);
+                               } else {
+                                       Logger::info('Mismatching permissions', ['condition' => $condition, 'photo' => $photo]);
+                               }
                                continue;
                        }