原创

如何访问七牛云带水印的图片?

郑重声明: 本文首发于人工博客

1、样式设置

先到七牛云oss控制台,设置图片样式

设置结果如下图:(设置细节不在这里详细描述,不太清楚的话自行百度)

2、如何访问

按照上图的结果这里有两个关键信息

样式的key: 94rg001

处理接口:

imageMogr2/auto-orient/thumbnail/150x150>/blur/1x0/quality/75|watermark/2/text/5Lq65bel5Y2a5a6i/font/5b6u6L2v6ZuF6buR/fontsize/240/fill/I0ZGRkZGRg==/dissolve/100/gravity/SouthEast/dx/10/dy/10

处理接口里面的详细的参数大家可以参考七牛云的文档

这里假设原图的请求地址是:

https://www.94rg.com/1.jpg

那么我们这里有两种方式可以获取到设定好的图片样式的水印图片

推荐方案: 原图地址+ (-样式key) -是连接符

https://www.94rg.com/1.jpg-94rg001

方案二: 原图地址+(?处理接口地址)

 https://www.94rg.com/1.jpg?imageMogr2/auto-orient/thumbnail/150x150>/blur/1x0/quality/75|watermark/2/text/5Lq65bel5Y2a5a6i/font/5b6u6L2v6ZuF6buR/fontsize/240/fill/I0ZGRkZGRg==/dissolve/100/gravity/SouthEast/dx/10/dy/10

3、方案的适用场景

方案一固定key,隐藏具体的处理逻辑,适合网站固定图片样式的,对于批量修改也是很方便的

方案二其实是直接调用七牛云的接口的,灵活性比较好,但是url比较长,且一旦生成,再去调整样式就比较麻烦


版权声明:本文为人工博客的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
本文链接:https://www.94rg.com/article/1725

%3E**%E9%83%91%E9%87%8D%E5%A3%B0%E6%98%8E**%3A%20%E6%9C%AC%E6%96%87%E9%A6%96%E5%8F%91%E4%BA%8E%5B%E4%BA%BA%E5%B7%A5%E5%8D%9A%E5%AE%A2%5D(https%3A%2F%2Fwww.94rg.com)%0A%0A%0A%23%23%23%20%201%E3%80%81%E6%A0%B7%E5%BC%8F%E8%AE%BE%E7%BD%AE%0A%0A%3E%20%E5%85%88%E5%88%B0%E4%B8%83%E7%89%9B%E4%BA%91oss%E6%8E%A7%E5%88%B6%E5%8F%B0%2C%E8%AE%BE%E7%BD%AE%E5%9B%BE%E7%89%87%E6%A0%B7%E5%BC%8F%0A%3E%0A%3E%20%E8%AE%BE%E7%BD%AE%E7%BB%93%E6%9E%9C%E5%A6%82%E4%B8%8B%E5%9B%BE%3A(%E8%AE%BE%E7%BD%AE%E7%BB%86%E8%8A%82%E4%B8%8D%E5%9C%A8%E8%BF%99%E9%87%8C%E8%AF%A6%E7%BB%86%E6%8F%8F%E8%BF%B0%EF%BC%8C%E4%B8%8D%E5%A4%AA%E6%B8%85%E6%A5%9A%E7%9A%84%E8%AF%9D%E8%87%AA%E8%A1%8C%E7%99%BE%E5%BA%A6)%0A%0A!%5B%E4%BA%BA%E5%B7%A5%E5%8D%9A%E5%AE%A2%5D(https%3A%2F%2Fae01.alicdn.com%2Fkf%2FH4d700f608292476b8055de090acddc24m.png)%0A%0A%0A%0A%23%23%23%202%E3%80%81%E5%A6%82%E4%BD%95%E8%AE%BF%E9%97%AE%0A%0A%E6%8C%89%E7%85%A7%E4%B8%8A%E5%9B%BE%E7%9A%84%E7%BB%93%E6%9E%9C%E8%BF%99%E9%87%8C%E6%9C%89%E4%B8%A4%E4%B8%AA%E5%85%B3%E9%94%AE%E4%BF%A1%E6%81%AF%0A%0A**%E6%A0%B7%E5%BC%8F%E7%9A%84key**%3A%20%60%60%6094rg001%60%60%60%0A%0A%E5%A4%84%E7%90%86%E6%8E%A5%E5%8F%A3%3A%0A%0A%60%60%60%0AimageMogr2%2Fauto-orient%2Fthumbnail%2F150x150%3E%2Fblur%2F1x0%2Fquality%2F75%7Cwatermark%2F2%2Ftext%2F5Lq65bel5Y2a5a6i%2Ffont%2F5b6u6L2v6ZuF6buR%2Ffontsize%2F240%2Ffill%2FI0ZGRkZGRg%3D%3D%2Fdissolve%2F100%2Fgravity%2FSouthEast%2Fdx%2F10%2Fdy%2F10%0A%60%60%60%0A%0A%E5%A4%84%E7%90%86%E6%8E%A5%E5%8F%A3%E9%87%8C%E9%9D%A2%E7%9A%84%E8%AF%A6%E7%BB%86%E7%9A%84%E5%8F%82%E6%95%B0%E5%A4%A7%E5%AE%B6%E5%8F%AF%E4%BB%A5%E5%8F%82%E8%80%83%E4%B8%83%E7%89%9B%E4%BA%91%E7%9A%84%E6%96%87%E6%A1%A3%0A%0A%E8%BF%99%E9%87%8C%E5%81%87%E8%AE%BE%E5%8E%9F%E5%9B%BE%E7%9A%84%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80%E6%98%AF%EF%BC%9A%0A%60%60%60%0Ahttps%3A%2F%2Fwww.94rg.com%2F1.jpg%0A%60%60%60%0A%E9%82%A3%E4%B9%88%E6%88%91%E4%BB%AC%E8%BF%99%E9%87%8C%E6%9C%89%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%E5%8F%AF%E4%BB%A5%E8%8E%B7%E5%8F%96%E5%88%B0%E8%AE%BE%E5%AE%9A%E5%A5%BD%E7%9A%84%E5%9B%BE%E7%89%87%E6%A0%B7%E5%BC%8F%E7%9A%84%E6%B0%B4%E5%8D%B0%E5%9B%BE%E7%89%87%0A%0A%3E%20%E6%8E%A8%E8%8D%90%E6%96%B9%E6%A1%88%EF%BC%9A%20%E5%8E%9F%E5%9B%BE%E5%9C%B0%E5%9D%80%2B%20%EF%BC%88-%E6%A0%B7%E5%BC%8Fkey%EF%BC%89%20-%E6%98%AF%E8%BF%9E%E6%8E%A5%E7%AC%A6%0A%60%60%60%0Ahttps%3A%2F%2Fwww.94rg.com%2F1.jpg-94rg001%0A%60%60%60%0A%0A%0A%3E%20%E6%96%B9%E6%A1%88%E4%BA%8C%3A%20%E5%8E%9F%E5%9B%BE%E5%9C%B0%E5%9D%80%2B(%3F%E5%A4%84%E7%90%86%E6%8E%A5%E5%8F%A3%E5%9C%B0%E5%9D%80)%0A%60%60%60%0A%20https%3A%2F%2Fwww.94rg.com%2F1.jpg%3FimageMogr2%2Fauto-orient%2Fthumbnail%2F150x150%3E%2Fblur%2F1x0%2Fquality%2F75%7Cwatermark%2F2%2Ftext%2F5Lq65bel5Y2a5a6i%2Ffont%2F5b6u6L2v6ZuF6buR%2Ffontsize%2F240%2Ffill%2FI0ZGRkZGRg%3D%3D%2Fdissolve%2F100%2Fgravity%2FSouthEast%2Fdx%2F10%2Fdy%2F10%0A%60%60%60%0A%0A%23%23%23%203%E3%80%81%E6%96%B9%E6%A1%88%E7%9A%84%E9%80%82%E7%94%A8%E5%9C%BA%E6%99%AF%0A%0A%3E%20%E6%96%B9%E6%A1%88%E4%B8%80%E5%9B%BA%E5%AE%9Akey%2C%E9%9A%90%E8%97%8F%E5%85%B7%E4%BD%93%E7%9A%84%E5%A4%84%E7%90%86%E9%80%BB%E8%BE%91%EF%BC%8C%E9%80%82%E5%90%88%E7%BD%91%E7%AB%99%E5%9B%BA%E5%AE%9A%E5%9B%BE%E7%89%87%E6%A0%B7%E5%BC%8F%E7%9A%84%EF%BC%8C%E5%AF%B9%E4%BA%8E%E6%89%B9%E9%87%8F%E4%BF%AE%E6%94%B9%E4%B9%9F%E6%98%AF%E5%BE%88%E6%96%B9%E4%BE%BF%E7%9A%84%0A%3E%0A%3E%20%E6%96%B9%E6%A1%88%E4%BA%8C%E5%85%B6%E5%AE%9E%E6%98%AF%E7%9B%B4%E6%8E%A5%E8%B0%83%E7%94%A8%E4%B8%83%E7%89%9B%E4%BA%91%E7%9A%84%E6%8E%A5%E5%8F%A3%E7%9A%84%EF%BC%8C%E7%81%B5%E6%B4%BB%E6%80%A7%E6%AF%94%E8%BE%83%E5%A5%BD%EF%BC%8C%E4%BD%86%E6%98%AFurl%E6%AF%94%E8%BE%83%E9%95%BF%EF%BC%8C%E4%B8%94%E4%B8%80%E6%97%A6%E7%94%9F%E6%88%90%EF%BC%8C%E5%86%8D%E5%8E%BB%E8%B0%83%E6%95%B4%E6%A0%B7%E5%BC%8F%E5%B0%B1%E6%AF%94%E8%BE%83%E9%BA%BB%E7%83%A6%0A%0A------%0A%0A%3E%20%E7%89%88%E6%9D%83%E5%A3%B0%E6%98%8E%EF%BC%9A%E6%9C%AC%E6%96%87%E4%B8%BA%E4%BA%BA%E5%B7%A5%E5%8D%9A%E5%AE%A2%E7%9A%84%E5%8E%9F%E5%88%9B%E6%96%87%E7%AB%A0%EF%BC%8C%E9%81%B5%E5%BE%AA%20CC%204.0%20BY-SA%20%E7%89%88%E6%9D%83%E5%8D%8F%E8%AE%AE%EF%BC%8C%E8%BD%AC%E8%BD%BD%E8%AF%B7%E9%99%84%E4%B8%8A%E5%8E%9F%E6%96%87%E5%87%BA%E5%A4%84%E9%93%BE%E6%8E%A5%E5%8F%8A%E6%9C%AC%E5%A3%B0%E6%98%8E%E3%80%82%0A%E6%9C%AC%E6%96%87%E9%93%BE%E6%8E%A5%EF%BC%9A%5Bhttps%3A%2F%2Fwww.94rg.com%2Farticle%2F1725%5D(https%3A%2F%2Fwww.94rg.com%2Farticle%2F1725)
正文到此结束
本文目录