You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
dnaz
9 months agoExplorer | Level 3
How can I get images width and height values in pixel with API V2
I have created an api with PHP language, I can connect list folders and files etc.. But I cant get the images width and height with api, How can I do this with the latest api documentation ?
ht...
dnaz
Explorer | Level 3
Hi, I have used it but cant get the width and height.
Здравко
9 months agoLegendary | Level 20
I just tried for an arbitrary image and its as follows (a bit shortened for clarity):
> POST /2/files/get_metadata
> Host: https://api.dropboxapi.com
> User-Agent: api-explorer-client
> Authorization: Bearer ***********valid*access*token********
> Content-Type: application/json
>
> {"path":"/IMG_20230616_150044.jpg","include_media_info":true}
< HTTP/2 200
< content-type: application/json
< server: envoy
< content-length: 568
<
< {".tag": "file", "name": "IMG_20230616_150044.jpg", "path_lower": "/img_20230616_150044.jpg", "path_display": "/IMG_20230616_150044.jpg", "id": "id:ElL7W-JPrdMAAAAAAABaqQ", "client_modified": "2023-06-16T12:01:28Z", "server_modified": "2023-06-16T12:01:29Z", "rev": "5fe3df1f1b42b22ab554a", "size": 1649795, "media_info": {".tag": "metadata", "metadata": {".tag": "photo", "dimensions": {"height": 4000, "width": 1840}, "time_taken": "2023-06-16T15:00:44Z"}}, "is_downloadable": true, "content_hash": "a373008e6d8daf0d0823cd623d38a949548d26d08f42a779cbf8ebde12c213cc"}
As can be seen both width and height are there. What exactly doesn't work for you?
- dnaz9 months agoExplorer | Level 3
I'm gettin this:
I'm using PHP Curl,
object(stdClass)#1 (11) { [".tag"]=> string(4) "file" ["name"]=> string(7) "S3x.png" ["path_lower"]=> string(37) "/vhq dxf/k-s-mr-archive/03-29/s3x.png" ["path_display"]=> string(37) "/VHQ DxF/K-S-MR-ARCHIVE/03-29/S3x.png" ["id"]=> string(25) "id:TvyxEphAjwwAAAAAAADawQ" ["client_modified"]=> string(20) "2024-03-29T17:50:47Z" ["server_modified"]=> string(20) "2024-04-03T23:19:39Z" ["rev"]=> string(31) "016153974e96a70000000010ef1" ["size"]=> int(12209354) ["is_downloadable"]=> bool(true) ["content_hash"]=> string(64) "3667ae13d1bd27da44f59c4c88bd69041fe0f95d8119bec35851a144759" }
- Здравко9 months agoLegendary | Level 20
😀 I'm receiving roughly the same (or equivalent) when I skip turning on the media info. Did you skip that step? (Note in the request body above: "include_media_info":true) 👆 By default media info is off!
Hope this clarifies matter.
- dnaz9 months agoExplorer | Level 3
yes 🙂
My url : $url = 'https://api.dropboxapi.com/2/files/get_metadata';
My curl post data = $data = '{"include_media_info": true,"path": "/VHQ DTF/K-S-MR-ARCHIVE/03-29/S37.png"}';
but I'm getting same results that without dimensions 🙂
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,915 PostsLatest Activity: 19 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!