Git Product home page Git Product logo

ali-img's People

Contributors

pengng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

l1-j5n

ali-img's Issues

adding quality() result in invalid x-oss-process query

失败的请求

AliImgProcessor(pathToFile).quality(78).format('jpg').interlace(1).write

错误信息

     HTTPError: <?xml version="1.0" encoding="UTF-8"?>
<Error>
  <Code>InvalidArgument</Code>
  <Message>The value: image of parameter: quality is invalid.reason:Value must be digit</Message>
  <RequestId>5F9C294EFBD3EC3132C30327</RequestId>
  <HostId>xycdp-dev.oss-cn-hangzhou.aliyuncs.com</HostId>
</Error>

错误原因

quality: value:88 this.query: {
  'auto-orient': 1,
  resize: { w: 360, h: 360, l: 360, limit: 1, m: 'lfit' },
  quality: 88
}
param: image/auto-orient,1,image/resize,w_360,h_360,l_360,limit_1,m_lfit,image/quality,88,image/format,jpg,image/interlace,1

其中 param 的操作名称多了 image/ ,参考文档 https://help.aliyun.com/document_detail/44705.html?spm=a2c4g.11186623.6.746.61a51176lIfEDR

修改方法

https://github.com/pengng/ali-img/blob/master/lib/img.js#L610

改为 return ${key},${param}

从而得到 param: param: auto-orient,1,resize,w_360,h_360,l_360,limit_0,m_lfit,quality,q_88,format,jpg,interlace,1
工作正常。

不理解的问题

那么为什么 param 需要 image/ 前缀呢?有没有对应的文档吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.