Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elisalimli/python-image-resizer
A basic python image resizer
https://github.com/elisalimli/python-image-resizer
docker dockerfile flask image-resize image-resizer image-resizing python service
Last synced: about 8 hours ago
JSON representation
A basic python image resizer
- Host: GitHub
- URL: https://github.com/elisalimli/python-image-resizer
- Owner: elisalimli
- License: mit
- Created: 2023-08-30T13:52:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-30T14:13:30.000Z (about 1 year ago)
- Last Synced: 2024-04-18T09:36:39.145Z (7 months ago)
- Topics: docker, dockerfile, flask, image-resize, image-resizer, image-resizing, python, service
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python Image Resizer
This is a simple Python application that accepts image URLs, creates thumbnails, and serves the resized images using Flask.
## Installation
Follow these steps to set up the project on your local environment:
1. Clone the project repository:
```bash
git clone https://github.com/elisalimli/python-image-resizer.git
```2. Navigate to the project's folder:
```bash
cd python-image-resizer
```3. Make sure you have Python 3 installed on your system.
4. Install the required packages:
```bash
pip install -r requirements.txt
```## Usage
To run the program, execute the following command:
```bash
python3 image_resizer.py
```This will start the Flask application, and you'll be able to access it through your web browser or by making HTTP requests.
## Running with Docker
Alternatively, you can use Docker to run the application in a container. Follow these steps:1. Build the docker image:
```bash
docker build -t image-resizer .
```2. Run the docker container:
```bash
docker run --rm -it -p 4000:4000 image-resizer
```This will build the image and run the application within a Docker container. The application will be accessible at http://localhost:4000.
## Usage Example
After running the application, you can use a tool like curl to make HTTP requests to the endpoints and test the image resizing functionality.For example, to create a thumbnail of an image, use the following command:
```bash
curl -X GET "http://localhost:4000/?size=256&url=http://example.com/"
```