Giter VIP home page Giter VIP logo

coresize's Introduction

coresize

core, because it's simple, resize, because it serves resized versions of your images

coresize aims to be a small server that can load images from local disk or S3 and serve resized and aligned versions of those images "on the fly". Here's what it supports:

  • Serve images directly from S3
  • Cache images locally to skip the S3 roundtrip next request
  • Specify width and height of new image
  • Specify alignment of image in new canvas (top, center, bottom, left, center, right)

CLI usage

Usage of coresize:
  -port=8080: Port to listen on
  -aws-client-key="": Only used when pull-from=s3
  -aws-secret-key="":
  -bucket="": S3 bucket
  -v=false: Be more verbose

GET /v1/i/:filename

Serves a file resized on-the-fly to the right format.

Parameters:

  • filename (string) Filename to render

Query string parameters:

  • width (int) Width of rendered image
  • height (int) Height of rendered image
  • align (enum{tl,tc,tr,cl,cc,cr,bl,bc,br}) How to align image
    • First character is x axis alignment {top, center, bottom}
    • Second character is y axis alignment {left, center, right}
+--------------+
|tl    tc    tr|
|              |
|cl    cc    cr|
|              |
|bl    bc    br|
+--------------+

Example request:

/v1/i/brewster.png?hash=1c2cc361&width=600&height=300&align=tc

Example response:

Some nice binary :D

License

MIT

coresize's People

Contributors

cdnbacon avatar

Watchers

 avatar

Forkers

nchaulet killix

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.