Git Product home page Git Product logo

imageman's Introduction

Server-side Image Manipulator

Fetch pre-scaled image from server. Reducing bandwidth for client and server both.

Author: Meet Usadadiya

How it works:

Diagram

Client-Side Demo:

Demo

Applications

This tool is useful when creating responsive site. This tool can helpful with img tag using srcset attribute:

<img
	srcset="
		http://url/img/meet.jpg?width=480 480w,
		http://url/img/meet.jpg?width=800 800w
	"
	sizes="(max-width: 600px) 480px,
            800px"
	src="http://url/img/meet.jpg?width=800"
	alt="Meet"
/>

Commands :

Start :
npm start
And this tool will start running on port 3000.

Run on Custom Port:
npm start port 1234
To run this tool on custom port, you have to specify port number using port argument.

Clean Cache:
npm clean-cache
This command will clear all cached images.

Setup Instructions:

  1. Clone this repository.
  2. Install Dependencies using npm install or yarn install
  3. Run server by using npm start or yarn start
  4. Use following API to save images on server:
    • Method: POST
    • URL : /upload
    • Body Content-Type: multipart/form-data
    • Field 1 Name: file
    • Value: an image-file
    • Header Name: name
    • Header Value: An Image name to be on server
  5. Or you can just place images in ./public/img folder

This will work with JPEG, PNG and SVG formats only. More features are coming soon....

PRs and Issues are welcomed. Thank You!

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.