Coder Social home page Coder Social logo

smart-crop's Introduction

smart-crop

图片智能裁剪,基于smartcrop.js开发,使用到作者QuadFlask:smartcrop-java项目的相关代码,集成到SpringBoot项目,方便使用

使用API

请求地址

POST http://localhost:9090/crop

请求参数(FormData)

属性 类型 必填 说明
imageUrl string 要检测的图片url
ratios string 宽高比
width number 裁剪的宽度
height number 裁剪的高度

返回参数

属性 类型 说明
crop Object 包括原点坐标xy,基于原点裁剪的width和height
image Object 包括图片的原始宽高(w/h)

返回数据示例

{
    "msg": "处理完成",
    "code": 0,
    "data": {
        "crop": {
            "x": 112,
            "y": 248,
            "width": 1080,
            "height": 1080
        },
        "image": {
            "w": 1200,
            "h": 1800
        }
    }
}

参考

https://github.com/QuadFlask/smartcrop-java

https://github.com/jwagner/smartcrop.js

smart-crop's People

Contributors

feirty avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.