GithubHelp home page GithubHelp logo

m-murad / compressor-head Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 37.0 5.82 MB

Server-side image compression solution.

Home Page: http://compressor-head.appspot.com/

License: Apache License 2.0

Go 100.00%
image compression resize resize-images image-compression image-compressor google-appengine remote image-downloader google-app-engine google-cloud-platform conversion convert-image memcache

compressor-head's Introduction

compressor-head

This application allows a user to compress/resize and convert an image before downloading it. This saves the user data that otherwise would be used to download big images. Also I have used the GCP memcache library which speeds up the process if same image is being retrieved by multiple users.

Usage

URL - http://compressor-head.appspot.com/image/?image_url=[IMAGE_URL]&width=[WIDTH]&height=[HEIGHT]&format=[FORMAT]

where

*IMAGE_URL* is the URL of the image which is to be compressed.
*WIDTH* is the desired width. 
*HEIGHT* is the desired height.
*FORMAT* is the desired image format (Supported formats - JPEG, PNG, WEBP, GIF, BMP, TIFF).

Both WIDTH and HEIGHT should be positive integers. Both WIDTH and HEIGHT cannot be zero. If one of the two is zero it will scale that non-zero dimension and the other dimension will be scaled such that the aspect ratio remains the same. If both are not zero, both dimensions will scale accordingly which might change the aspect ratio of the image.

Usage example

Sample Image URL - http://compressor-head.appspot.com/image
This is a 5.8 MB JPEG image. Dimension 5649ร—3684

To resize the image -

  • Resize (Width) : http://compressor-head.appspot.com/image/?image_url=http://compressor-head.appspot.com/image&width=500&height=0&format=jpeg

    This will return an image 37 KB JPEG image with dimensions 500x326

  • Resize (Height) : http://compressor-head.appspot.com/image/?image_url=http://compressor-head.appspot.com/image&width=0&height=250&format=png

    This will return an image 164 KB PNG image with dimensions 383x250

  • Resize (Width & Height) : http://compressor-head.appspot.com/image/?image_url=http://compressor-head.appspot.com/image&width=500&height=350&format=jpeg

    This will return an image 41 KB JPEG image with dimensions 500x350

Author

@m-murad

License

Apache Version 2.0

compressor-head's People

Contributors

m-murad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

compressor-head's Issues

Image not resizing

Hi, I am trying to resize an image but the api endpoint doesn't seem to work.
The example URL you've provided http://compressor-head.appspot.com/image?image_url=http://compressor-head.appspot.com/image&width=500&height=350&format=jpeg is a little strange because it using the same url http://compressor-head.appspot.com/image fot both api endpoint and image url. Is there some issue with url formatting?
Can you provide me with a working example url so I can understand how it works?

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.