Image dimensions metadata on google-cloud-storage.

2019-08-19 08:12发布

I need to know the dimensions of images I'm saving, so that I can add them to the og:image:width and og:image:height meta tags for image previewing by Facebook, Twitter etc - as is suggested by this Facebook documentation.

If I'm saving these images to a google storage bucket - is there any already existing way of finding these images sizes with existing standard metadata, or will I need to add some custom metadata as described in this google documentation?

1条回答
仙女界的扛把子
2楼-- · 2019-08-19 08:42

Given that Cloud Storage sees everything as objects, it does not have multiple object definitions, depending on the type of the object (like media, text... it does something like this via Content-Type but it's not what you're looking for). In this sense, there are no object type characteristic-metadata (i.e. width and height of images or length for sounds or videos).

The only predefined (or how you call it, standard) metadata entries are the ones mentioned here and, yes, as you specified, you need to add custom metadata.

查看更多
登录 后发表回答