Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
dnaz
2 years 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...
Здравко
2 years agoLegendary | Level 20
Hi dnaz,
To get image or video media info in metadata you need to call /2/files/get_metadata endpoint. The media info is not supported on other endpoints for number of years already.
Hope this helps.
- dnaz2 years agoExplorer | Level 3
Hi, I have used it but cant get the width and height.
- Здравко2 years 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?
- dnaz2 years 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" }
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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, Facebook or Instagram.
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!