Google-cloud-storage上的图片维度元数据。 [英] Image dimensions metadata on google-cloud-storage.
问题描述
我需要知道我正在保存的图像的尺寸,以便我可以将它们添加到 og:image:width
和 og :image:height
用于Facebook,Twitter等图像预览的元标记 -
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.
如果我将这些图像保存到谷歌存储桶中 - 是否已存在使用现有标准元数据查找这些图片大小的方法,或者我是否需要添加一些自定义元数据如本google文档中所述?
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?
推荐答案
鉴于云存储将所有内容视为对象,它没有多个对象定义,具体取决于对象的类型(如媒体,文本......它做的事情)像这样通过 Content-Type
,但它是不是你想要的)。在这个意义上,没有对象类型特征 - 元数据(即图像的宽度和高度或声音或视频的长度)。
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.
这篇关于Google-cloud-storage上的图片维度元数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!