Giter Club home page Giter Club logo

resizer's Introduction

Resizer

Resizer is an http image resizer. It uses magickwand to resize images on the fly. Source images are obtained from an upstream (file/http). They can optionally be cached to a downstram (file/s3).

Getting Started

Set your GOPATH, then install using

go get github.com/qzaidi/resizer

This will create $GOPATH/bin/resizer, which is an http server.

Before running resizer binary, make sure to create a config file (in CWD or in /etc). There's a sample config in cfg/

[Server]
Port = 4000 # Port to listen on

[Upstream]
URI = http://catalogadmin.paytm.com # Server to download source images from

[Downstream]
URI = s3://ABCDEFGHIJ:[email protected] # S3 server to save resized images to

Pre-commit hook

The following hook should be copied to .git/hooks/pre-commit to enable versioning.

#!/bin/sh
 
#picked from  http://alimoeenysbrain.blogspot.com/2013/10/automatic-versioning-with-git-commit.html
VERBASE=$(git rev-parse --verify HEAD | cut -c 1-7)
echo $VERBASE
NUMVER=$(awk '{printf("%s", $0); next}' version.go | sed 's/.*Resizer\.//' | sed 's/\..*//')
echo "old version: $NUMVER"
NEWVER=$(expr $NUMVER + 1)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo "new version: Resizer.$NEWVER.$VERBASE"
BODY="package main\n\nfunc ResizerVersion() string {\n\treturn \"Resizer.$NEWVER.$BRANCH.$VERBASE\"\n}\n"
echo $BODY > version.go
git add version.go

resizer's People

Contributors

qzaidi avatar sakhtar avatar

Watchers

Prayag Verma  avatar James Cloos 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.