]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Funkwhale context file moved
[friendica.git] / src / Model / Photo.php
index ba4db6aca8f4127491800cc050f8c37ede054c09..096915523c6c6c3022429f2563073bd04a83fb08 100644 (file)
@@ -167,7 +167,7 @@ class Photo
 
                $sql_acl = Security::getPermissionsSQLByUserId($uid, $accessible);
 
-               $conditions = ['`resource-id` = ? AND `scale` <= ? ' . $sql_acl, $resourceid, $scale];
+               $conditions = ["`resource-id` = ? AND `scale` <= ? " . $sql_acl, $resourceid, $scale];
                $params = ['order' => ['scale' => true]];
                $photo = self::selectFirst([], $conditions, $params);
 
@@ -250,7 +250,7 @@ class Photo
         */
        private static function getFields(): array
        {
-               $allfields = DBStructure::definition(DI::app()->getBasePath(), false);
+               $allfields = DI::dbaDefinition()->getAll();
                $fields = array_keys($allfields['photo']['fields']);
                array_splice($fields, array_search('data', $fields), 1);
                return $fields;
@@ -333,7 +333,7 @@ class Photo
         */
        public static function store(Image $image, int $uid, int $cid, string $rid, string $filename, string $album, int $scale, int $type = self::DEFAULT, string $allow_cid = '', string $allow_gid = '', string $deny_cid = '', string $deny_gid = '', string $desc = ''): bool
        {
-               $photo = self::selectFirst(['guid'], ['`resource-id` = ? AND `guid` != ?', $rid, '']);
+               $photo = self::selectFirst(['guid'], ["`resource-id` = ? AND `guid` != ?", $rid, '']);
                if (DBA::isResult($photo)) {
                        $guid = $photo['guid'];
                } else {
@@ -586,11 +586,13 @@ class Photo
        }
 
        /**
+        * Returns a float that represents the GPS coordinate from EXIF data
+        *
         * @param array $exifCoord coordinate
         * @param string $hemi      hemi
         * @return float
         */
-       public static function getGps(array $exifCoord, strinf $hemi): float
+       public static function getGps(array $exifCoord, string $hemi): float
        {
                $degrees = count($exifCoord) > 0 ? self::gps2Num($exifCoord[0]) : 0;
                $minutes = count($exifCoord) > 1 ? self::gps2Num($exifCoord[1]) : 0;