cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 

no media info for PNG files in v2 API: /list_folder

DarioJG
Explorer | Level 4

Hi, I am trying to filter images (PNG files) and videos (.mov files) from the list received in /list_folder response. In API v1 we had the mimeType which was simple and efficient.

In v2 API I am trying to use the media_info structure, but unfortunately it is not returned for PNG files.

Also, the media_info does not allow to diferentiate files like mimeType permited (for example .mov from .avi or .png from .jpg) is there another way other than checking the filename extension to do this?

 

Example response:

"entries": [
    {
      ".tag": "file",
      "name": "bearAs-alpha.moveText-alpha.mov",
      "path_lower": "/overlays/bearas-alpha.movetext-alpha.mov",
      "path_display": "/overlays/bearAs-alpha.moveText-alpha.mov",
      "id": "id:YZb3V2wJUkAAAAAAAAAADg",
      "client_modified": "2017-01-17T19:44:42Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14b531bef6e",
      "size": 56716,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "video",
          "dimensions": {
            "height": 600,
            "width": 600
          },
          "duration": 0
        }
      },
      "content_hash": "7687ef246ee232d9adfc50cdb902d5d898aea6addd752572e9e9072287525293"
    },
    {
      ".tag": "file",
      "name": "bearJPG.jpg",
      "path_lower": "/overlays/bearjpg.jpg",
      "path_display": "/overlays/bearJPG.jpg",
      "id": "id:YZb3V2wJUkAAAAAAAAAADQ",
      "client_modified": "2017-01-17T19:44:41Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14c531bef6e",
      "size": 52650,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "photo",
          "dimensions": {
            "height": 600,
            "width": 600
          }
        }
      },
      "content_hash": "bd28df65c638e14c7c880a7f81b115a4f68fd30f4c5111816bb19291f7a26191"
    },
    {
      ".tag": "file",
      "name": "LaTierra-NoAudio-Explosion.avi",
      "path_lower": "/overlays/latierra-noaudio-explosion.avi",
      "path_display": "/overlays/LaTierra-NoAudio-Explosion.avi",
      "id": "id:YZb3V2wJUkAAAAAAAAAASg",
      "client_modified": "2017-02-14T16:47:08Z",
      "server_modified": "2017-02-24T15:22:51Z",
      "rev": "14e531bef6e",
      "size": 10271744,
      "media_info": {
        ".tag": "metadata",
        "metadata": {
          ".tag": "video",
          "dimensions": {
            "height": 384,
            "width": 512
          },
          "duration": 17033
        }
      },
      "content_hash": "204416633101d21085ea55372b0319469004ece50cf6c2b84b056426766d83e5"
    },
    {
      ".tag": "file",
      "name": "rightBear.png",
      "path_lower": "/overlays/rightbear.png",
      "path_display": "/overlays/rightBear.png",
      "id": "id:YZb3V2wJUkAAAAAAAAAAOw",
      "client_modified": "2017-02-08T22:56:41Z",
      "server_modified": "2017-04-17T16:23:19Z",
      "rev": "367531bef6e",
      "size": 85705,
      "content_hash": "e30da824cb832fb62e9d8560a10bfcbda7774abd170aabb9559c80199ee711eb"
    }
  ],

 

1 Accepted Solution

Accepted Solutions

Re: no media info for PNG files in v2 API: /list_folder

Dropboxer
Dropboxer
Thanks for the post! This is expected, media information won't be returned for all media types. With API v2, you should use the file extension in place of the mime type. I'll be sure to pass this along as feedback though.

View solution in original post

2 Replies 2

Re: no media info for PNG files in v2 API: /list_folder

Dropboxer
Dropboxer
Thanks for the post! This is expected, media information won't be returned for all media types. With API v2, you should use the file extension in place of the mime type. I'll be sure to pass this along as feedback though.

View solution in original post

Re: no media info for PNG files in v2 API: /list_folder

DarioJG
Explorer | Level 4
Understood, thanks for the quick reply. As additional feedback, I think PNG (or any other graphic file format for that matter) should receive the same treatement as a JPG file and hence include the media_info information (regardless the fact that jpg might be the most popular format for photos). Perhaps media_info should include additional information in that case (a file format field for example).

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?