Coder Social home page Coder Social logo

envision's Introduction

envision

An image validation web service.

Request

Requests are made with GET where validation parameters can be passed in as part of the query string. For example:

http://example.com/validate?image=http%3A%2F%2Florempixel.com%2F40%2F20%2F&min-height=50&mimetype=image/jpeg

Multiple parameters can be used in the same request. The available parameters are:

  • image: An encoded url path to the image for validation. This parameter is required.
  • min-height: Minimum height in pixels as an integer.
  • max-height: Maximum height in pixels as an integer.
  • min-width: Minimum width in pixels as an integer.
  • max-width: Maximum width in pixels as an integer.
  • mimetype: A valid image mimetype.

A demo of this service is available at image-envision.herokuapp.com.

Response

The response body data are formatted as JSON. For example:

{
  "info": {
    "size": {
      "width": 40,
      "height": 20
    },
    "type": "jpeg"
  },
  "valid": false,
  "invalid": {
    "size": {
      "message": "Invalid size"
    }
  },
}

A typical response body consists of the following parts:

  • valid: A boolean property that indicates whether the provided image is valid based on the validation criteria.
  • info: An object that provides relevant information about the image based on the validation criteria.
  • invalid: An object that indicates the failing validation types.

CORS Support

CORS, or cross-origin resource sharing, is a mechanism that allows a web page to make XMLHttpRequests to another domain. The 'envision' image validation API supports CORS but please note that some older browsers (e.g. IE7) may not support this mechanism.

envision's People

Contributors

ndnhat avatar

Stargazers

 avatar

Watchers

James Cloos 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.