ahmed-hany94 / image-processing-api

Udacity FWD's first project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

image-processing-api

Udacity FWD's first project

This project servers as a placeholder api and an image conversion api.


Setup:

Install:

git clone https://github.com/ahmed-hany94/image-processing-api

cd image-processing-api

yarn install

Run:

yarn start

Routes:

/

redirects to /public/index.html for the submission form.

/api/images/

A listing of the files in ./assets/full directory. index page

/public/index.html

You submit an image as shown below with the desired dimensions & an optional extension to be converted into.

form to submit images

If the operation is successful, the browser takes you to the image served by the express server.

/api/images?filename=<filename.ext>&width=&height=&ext=

result url http://localhost:3000/api/images?filename=fjord.jpg&width=200&height=200&ext=png

If you go to a url of an already converted image, express servers the cached image file from its directory without converting it again.


Notes:

  • Using the submission form is preferred.
  • Files that are converted are found in /assets/thumb with the format: <filename>-<width>-<height>.<ext>
  • đź’€ url format must be as mentioned /api/images?filename=<filename.ext>&width=<number>&height=<number>&ext=<ext> when using the api directly without using the submission form.

About

Udacity FWD's first project

License:MIT License


Languages

Language:TypeScript 69.2%Language:CSS 14.2%Language:HTML 10.0%Language:JavaScript 6.5%