Tumblr图像的URL架构是什么? [英] What is the URL schema of Tumblr images?
问题描述
Tumblr的图像文件架构是什么? (我不是指 HTTP
)
我只是想到存储图像的服务器的域是< n> .media.tumblr.com
,其中 n
是1到31之间的数字,图像文件的名称前缀为 tumblr _
。
What is the schema of a image-file at Tumblr? (I don't mean HTTP
)
I've only figured out that the domain of the servers where images are stored is <n>.media.tumblr.com
, where n
is a number between 1 and 31 and the name of the image file is prefixed with "tumblr_
.
我问,因为我想查找引用相同图像的网址。
I'm asking because I want to find URLs that refer to the same image.
编辑:我也在处理来自其他来源的网址,而不仅仅是Tumblr。
I'm also processing URLs from other sources, not only Tumblr.
推荐答案
< h3>概述
当您将图像上传到Tumblr时,会生成多个(同一图像的)大小并存储在其网络中。
Overview
When you upload an image to Tumblr, multiple sizes (of the same image) are generated and stored across their network.
上传后,您可以使用模板标签要求此图片的尺寸如下: 75 , 100 , 250 , 400 , 500 和 1280 。
Once uploaded, you can use template tags to request this image at the following sizes: 75, 100, 250, 400, 500 and 1280.
值得一提的是:
- 模板标签中的值是所请求图像的最大尺寸。示例: 400 版本的图片可以是 251px 和 400px 宽/高之间的任何位置。
- 可能没有可用的高分辨率或 1280 版本的影像。如果原始图像 500px 或更低,则不会生成 1280 版本。
- 相册不会产生 100 版本。
- The value in the template tag is the maximum size the requested image will be. Example: A 400 version of an image could be anywhere between 251px and 400px wide / high.
- There may not be a high res or 1280 version of an image available. If the original image is 500px or less, a 1280 version isn't generated.
- Photosets don't produce a 100 version.
图片网址
图片网址将是以下两种图片之一。第一个URL似乎与超过6个月前上传的图片相关联(这是猜测),第二个URL似乎是针对较新的图片:
Image URL
The image URL will be either of the two below. The first URL seems to be associated with images upload more than 6 months ago (this is a guess), the second URL seems to be for newer images:
http://36.media.tumblr.com/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg
或
http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg
网址架构
这可以分成三个部分,两个变量,一个常数。
URL Schema
This can be split into three parts, two variables, one constant.
-
http:// 36
-
.media.tumblr.com / 83099a60d4e0cbeeb30d90394e222878 / tumblr_o4qxa0n2BP1r6ec7zo1
-
_500.jpg
http://36
.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1
_500.jpg
1 这是一个服务器编号,可能因图像大小而异。 AFAIK无法保证所有服务器上都可以使用图像大小。 @Ally在评论中提到你可以从URL中删除这部分,仍然可以找到图像。
2 这是Tumblr子域名,目录(如果适用)和部分文件名。对于所有尺寸,这都是相同的。
3 这是请求的大小(与模板标签匹配)和文件扩展名。
1 This is a server number and can differ for each image size. AFAIK there is no guarantee that an image size will be available on all servers. @Ally mentioned in the comments you can remove this part from the URL and the image will still be found.
2 This is the Tumblr subdomain, directory (if applicable) and partial file name. This will be the same for all sizes.
3 This is the requested size (which matches the template tag) and file extension.
唯一我发现的万无一失的方法是使用相应的模板标签并将它们分配给 data -
属性。
The only foolproof method I have found is to use the corresponding template tags and assign them to a data-
attribute.
示例模板代码:
<img src="{PhotoURL-100}" data-250u="{PhotoURL-250}" data-400u="{PhotoURL-400}" data-500u="{PhotoURL-500}" data-1280u="{block:HighRes}{PhotoURL-HighRes}{/block:HighRes}" />
示例呈现代码:
<img src="http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_100.jpg" data-250u="http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_250.jpg" data-400u="http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_400.jpg" data-500u="http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg" data-1280u="http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_1280.jpg" >
使用此方法,您可以确定您拥有正确的网址,并且您知道可用的尺寸。
With this method, you can be certain you have the correct URLs and you know what sizes are available.
使用此信息,URL将变为:
Using this information the URL would become:
http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg
以下是确认我们可以访问所有可用尺寸的测试:
Below is a test to confirm we access all the available sizes:
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_100.jpg
- http://36.media .tumblr.com / 83099a60d4e0cbeeb30d90394e222878 / tumblr_o4qxa0n2BP1r6ec7zo1_250.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_400.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg
- http://36.media.tumblr .com / 83099a60d4e0cbeeb30d90394e222878 / tumblr_o4qxa0n2BP1r6ec7zo1_1280.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_100.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_250.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_400.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_500.jpg
- http://36.media.tumblr.com/83099a60d4e0cbeeb30d90394e222878/tumblr_o4qxa0n2BP1r6ec7zo1_1280.jpg
您仍然不知道是否已生成1280尺寸,但是它更近了一步。使用此方法,您可以使用新尺寸替换值(第3部分),应能够获取图像。
You still wouldn't know if the 1280 size has been generated, but its a step closer. With this method you could replace the value (part 3) with an new size and you should be able to get the image.
这篇关于Tumblr图像的URL架构是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!