所有App Engine图像的列表service get_serving_url()URI选项 [英] List of all the App Engine images service get_serving_url() URI options

查看:87
本文介绍了所有App Engine图像的列表service get_serving_url()URI选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为回应






SIZE / CROP




  • s640 —生成最大尺寸为640像素的图像

  • s0 - —原始尺寸图片

  • w100 —生成100像素宽的图像

  • h100 - —生成图像高度为100像素
  • s (无值) - —拉伸图像以适合尺寸

  • c —农作物图像提供维度

  • n —与 c 相同,但是来自中心的作物

  • p —智能方形裁剪,尝试裁剪脸部

  • pp —备用智能方块作物,不会切断面孔(?)
  • cc —生成循环剪切图像

  • ci —平方米作物最小值:宽度,高度或指定的= s参数
  • nu —无倍增。禁用将图像调整为大于其原始分辨率的大小。

  • ul>
  • x,y,z:—平移和缩放平铺的图像。这些对没有影响的图像或没有某种形式的授权参数没有影响(请参阅googleartproject.com)。



旋转




  • fv —垂直翻转

  • fh —水平翻转

  • r {90,180,270} —顺时针旋转图像90,180或270度

    $ b

    图像格式




    • rj - 强制生成的图片为JPG

    • rp - 强制生成的图片为PNG

    • rw - 强制生成的图片为WebP

    • rg - 强制产生的图像为GIF

    • v {0,1,2,3} - 将图像设置为不同的格式选项(适用于JPG和WebP)




    强制PNG,WebP和GIF输出可与圆形作物一起使用,以实现透明背景。强制JPG可以与边框颜色相结合以填充透明图像的背景。



    动画GIF




    • rh —根据输入图像生成MP4

    • k —杀死动画(生成静态图像)


      MISC。


      • b10 —为图片添加10px边框

      • c0xAARRGGBB —设置边框颜色,例如。 = c0xffff0000红色

      • d —添加标题以导致浏览器下载

      • e7

      • l100 —设置缓存控制最大年龄标头将JPEG质量设置为100%(1-100)

      • h —使用包含图片的HTML页面进行响应

      • g —用Google的pan / zoom使用的XML响应



      过滤器




      • fSoften = 1,100,0: - 其中100可以从0变为100以模糊图像

      • fVignette = 1,100,1.4 ,0,000000 其中100控制渐变的大小,000000是边框阴影颜色的RRGGBB。
      • fInvert = 0,1 无论所提供的价值如何,图像都会反转

      • fbw = 0,1 无论所提供的值如何,图像都是黑白的。


      未知参数



      这些参数已被使用,但其效果未知:否,nd,mv

      警告



      有些选项似乎没有产生新的图像。如果更改其他选项(尺寸等)并更改l值,则质量更改应可见。有些选项也不能很好地协同工作。这完全是谷歌没有记录的,可能有很好的理由。



      此外,依靠这些永远存在的选项可能不是一个好主意。 Google可能随时将其中大部分内容删除,而无需通知。

      In response to another question, a commenter mentioned an undocumented URI option I was not aware of to flip images horizontally/vertically with the App Engine images service.

      The documentation mentions a few basic options:

      • =s0 — fullsize
      • =s640 — longest edge 640px long
      • =s640-c — 640px square

      Would be nice to generate a comprehensive list of options, or if someone could provide any more options they know about here to serve as de facto documentation.

      解决方案

      Between reading some random posts and manually doing some investigative research, I have put together the following list. Please drop any other knowledge in other answers or in comments and I can integrate it here.

      Usage Example

      We can effect various image transformations by tacking strings onto the end of an App Engine blob-based image URL, following an = character. Options can be combined by separating them with hyphens, eg.:

      http://[image-url]=s200-fh-p-b10-c0xFFFF0000
      

      or:

      http://[image-url]=s200-r90-cc-c0xFF00FF00-fSoften=1,20,0:
      

      ... which have the following effect (documentation below):

      As an example of how awesome this is, here's an animated GIF, downsized and inverted:

      … which we can then convert into an MP4 video with one extra parameter: click to see MP4 version


      SIZE / CROP

      • s640 — generates image 640 pixels on largest dimension
      • s0 — original size image
      • w100 — generates image 100 pixels wide
      • h100 — generates image 100 pixels tall
      • s (without a value) — stretches image to fit dimensions
      • c — crops image to provided dimensions
      • n — same as c, but crops from the center
      • p — smart square crop, attempts cropping to faces
      • pp — alternate smart square crop, does not cut off faces (?)
      • cc — generates a circularly cropped image
      • ci — square crop to smallest of: width, height, or specified =s parameter
      • nu — no-upscaling. Disables resizing an image to larger than its original resolution.

      PAN AND ZOOM

      • x, y, z: — pan and zoom a tiled image. These have no effect on an untiled image or without an authorization parameter of some form (see googleartproject.com).

      ROTATION

      • fv — flip vertically
      • fh — flip horizontally
      • r{90, 180, 270} — rotates image 90, 180, or 270 degrees clockwise

      IMAGE FORMAT

      • rj — forces the resulting image to be JPG
      • rp — forces the resulting image to be PNG
      • rw — forces the resulting image to be WebP
      • rg — forces the resulting image to be GIF

      • v{0,1,2,3}sets image to a different format option (works with JPG and WebP)

      Forcing PNG, WebP and GIF outputs can work in combination with circular crops for a transparent background. Forcing JPG can be combined with border color to fill in backgrounds in transparent images.

      ANIMATED GIFs

      • rh — generates an MP4 from the input image
      • k — kill animation (generates static image)

      MISC.

      • b10 — add a 10px border to image
      • c0xAARRGGBB — set border color, eg. =c0xffff0000 for red
      • d — adds header to cause browser download
      • e7 — set cache-control max-age header on response to 7 days
      • l100 — sets JPEG quality to 100% (1-100)
      • h — responds with an HTML page containing the image
      • g — responds with XML used by Google's pan/zoom

      Filters

      • fSoften=1,100,0: - where 100 can go from 0 to 100 to blur the image
      • fVignette=1,100,1.4,0,000000 where 100 controls the size of the gradient and 000000 is RRGGBB of the color of the border shadow
      • fInvert=0,1 inverts the image regardless of the value provided
      • fbw=0,1 makes the image black and white regardless of the value provided

      Unknown Parameters

      These parameters have been seen in use, but their effect is unknown: no, nd, mv

      Caveats

      Some options (like =l for JPEG quality) do not seem to generate new images. If you change another option (size, etc.) and change the l value, the quality change should be visible. Some options also don't work well together. This is all undocumented by Google, probably with good reason.

      Moreover, it's probably not a good idea to depend on any of these options existing forever. Google could remove most of them without notice at any time.

      这篇关于所有App Engine图像的列表service get_serving_url()URI选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆