GithubHelp home page GithubHelp logo

vecto.images's Introduction

Vecto.Images

vecto task

Get editor settings so you can build up a view with correct UI elements:

curl --location --request GET 'http://localhost:5000/api/v1/images/editor'

response example:

{
    "fields": [
        {
            "name": "Resize to px",
            "editorStrategy": "RawInput",
            "key": "Vecto.Images.Plugins.Resizer.ResizerPluginData",
            "value": {
                "pixelsHeight": 0,
                "pixelsWidth": 0
            }
        },
        {
            "name": "Add blur of pixels size",
            "editorStrategy": "RawInput",
            "key": "Vecto.Images.Plugins.BlurPlugin.BlurPluginData",
            "value": {
                "pixels": 0
            }
        },
        {
            "name": "Convert to grayscale",
            "editorStrategy": "Checkbox",
            "key": "Vecto.Images.Plugins.GrayscalePlugin.GrayscalePluginData",
            "value": {
                "apply": false
            }
        }
    ]
}

With this structure you can render the proper UI

• Image#1: resize to 100 pixels, add blur 2 pixels size

curl --location --request POST 'http://localhost:5000/api/v1/images/' \
--form 'file=@"/C:/Users/ttehb/OneDrive/test.png"' \
--form 'data="{
    \"fields\": [{
            \"key\": \"Vecto.Images.Plugins.Resizer.ResizerPluginData\",
            \"value\": {
                \"pixelsHeight\": 100,
                \"pixelsWidth\": 100
            }
        }, {
            \"key\": \"Vecto.Images.Plugins.BlurPlugin.BlurPluginData\",
            \"value\": {
                \"pixels\": 2
            }
        }
    ]
}"'

• Image#2: resize to 100 pixels

curl --location --request POST 'http://localhost:5000/api/v1/images/' \
--form 'file=@"/C:/Users/ttehb/OneDrive/test.png"' \
--form 'data="{
    \"fields\": [{
            \"key\": \"Vecto.Images.Plugins.Resizer.ResizerPluginData\",
            \"value\": {
                \"pixelsHeight\": 100,
                \"pixelsWidth\": 100
            }
        }
    ]
}"'

• Image#3: resize to 150 pixels, add blur 5 pixels size, convert to grayscale

curl --location --request POST 'http://localhost:5000/api/v1/images/' \
--form 'file=@"/C:/Users/ttehb/OneDrive/test.png"' \
--form 'data="{
    \"fields\": [{
            \"key\": \"Vecto.Images.Plugins.Resizer.ResizerPluginData\",
            \"value\": {
                \"pixelsHeight\": 150,
                \"pixelsWidth\": 150
            }
        }, {
            \"key\": \"Vecto.Images.Plugins.BlurPlugin.BlurPluginData\",
            \"value\": {
                \"pixels\": 5
            }
        }, {
            \"key\": \"Vecto.Images.Plugins.GrayscalePlugin.GrayscalePluginData\",
            \"value\": {
                \"apply\": true
            }
        }
    ]
}"'

vecto.images's People

Contributors

baguwka avatar

Watchers

 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.