]> git.mxchange.org Git - friendica.git/commitdiff
closes #6272
authorroot <17hado.com@gmail.com>
Sun, 16 Dec 2018 06:16:45 +0000 (06:16 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 21 Jan 2019 14:12:33 +0000 (09:12 -0500)
doc/api.md
include/api.php
tests/include/ApiTest.php

index 2715f44462ea2392e7cc20ddde78362df97ac74d..0f2243b5c1bb316315c3787f34c74fde53f49dfd 100644 (file)
@@ -379,6 +379,18 @@ Friendica doesn't allow showing the friends of other users.
 
 * media: image data
 
+#### Return values
+
+Object of:
+
+* media_id: a media identifier (integer)
+* media_id_string: a media identifier (string)
+* size: size in byte
+* image.w: image width
+* image.h: image height
+* image.image_type: image mime type
+* image.friendica_preview_url: image preview url
+
 ---
 
 ### oauth/request_token (*)
index 8a89d00d773cd7ebc354bc5d2c1f44c30e9b4484..1fca7966709372ea63be03e624cb909bb67fdd2f 100644 (file)
@@ -945,7 +945,6 @@ function api_format_data($root_element, $type, $data)
                        $ret = $data;
                        break;
        }
-
        return $ret;
 }
 
@@ -1244,7 +1243,7 @@ function api_media_upload()
        $returndata["image"] = ["w" => $media["width"],
                                "h" => $media["height"],
                                "image_type" => $media["type"],
-                               "preview" => $media["preview"]];
+                               "friendica_preview_url" => $media["preview"]];
 
        Logger::log("Media uploaded: " . print_r($returndata, true), Logger::DEBUG);
 
@@ -5685,7 +5684,6 @@ function api_friendica_notification($type)
 
                $notes = $xmlnotes;
        }
-
        return api_format_data("notes", $type, ['note' => $notes]);
 }
 
index e4e654f464c23bd9685fed0828bf3ea84ec15a14..270f66aa5393f399d45a427928891f62c2955a3a 100644 (file)
@@ -1249,6 +1249,7 @@ class ApiTest extends DatabaseTest
                $this->assertEquals('image/png', $result['media']['image']['image_type']);
                $this->assertEquals(1, $result['media']['image']['w']);
                $this->assertEquals(1, $result['media']['image']['h']);
+               $this->assertNotEmpty($result['media']['image']['friendica_preview_url']);
        }
 
        /**