Image dimensions metadata on google-cloud-storage.

半腔热情 提交于 2019-12-11 15:48:32

问题


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:


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.



来源:https://stackoverflow.com/questions/50323461/image-dimensions-metadata-on-google-cloud-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!