From 595ace3d165cb922d06baa8434f308efea74d4c0 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Tue, 18 Feb 2020 16:31:31 -0300 Subject: [PATCH 1/3] teste --- .DS_Store | Bin 0 -> 6148 bytes app.py | 11 +++++------ core.py | 1 - plat.py | 1 + templates/processing.html | 12 ++++++------ 5 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 .DS_Store create mode 100644 plat.py diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3238e62056c4a52b7bd1750259f508a286b7598a GIT binary patch literal 6148 zcmeHK%SyvQ6g{I|RNQpwa(+OIe-KN$Qx}SRTT-O>3TcYyDxdDT55-{IN|k$I=G^DZ zik(SfOD*#RIixJYhk*qBdpKijjM?v})Qfw3m$6YOTq}0(bNsvqCc0cq2Bn zYrHc5r}-~^{(;r)B9XDCU?3O>27-Y-D{=`UDPJi~i!m%^7awMIZCPF0t4^/", methods=["GET"]) def rotate(angle, filename): diff --git a/plat.py b/plat.py new file mode 100644 index 0000000..f0275fc --- /dev/null +++ b/plat.py @@ -0,0 +1 @@ +sky = (1000, 1500) \ No newline at end of file diff --git a/templates/processing.html b/templates/processing.html index 99d906e..87e50c2 100644 --- a/templates/processing.html +++ b/templates/processing.html @@ -57,19 +57,19 @@

Crop

Rotate

-
- + +
- +

Blend

-
- + +
- +
From 07e32e721ce921ecbfec80f65e77041743bd50b6 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Thu, 20 Feb 2020 13:02:40 -0300 Subject: [PATCH 2/3] export NOW --- .idea/image-api.iml | 8 ++++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 7 +++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ app.py | 4 ++-- plat.py | 3 ++- templates/processing.html | 4 ++-- 8 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .idea/image-api.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/image-api.iml b/.idea/image-api.iml new file mode 100644 index 0000000..4e6ce24 --- /dev/null +++ b/.idea/image-api.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b6db721 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..dbc19f7 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app.py b/app.py index 92fcebb..5a41619 100644 --- a/app.py +++ b/app.py @@ -50,7 +50,7 @@ def upload(): @app.route("/rotate", methods=["POST"]) def rotate(): # retrieve parameters from html form - angle = request.form['angle'] + #angle = request.form['angle'] filename = request.form['image'] # open and process image @@ -58,7 +58,7 @@ def rotate(): destination = "/".join([target, filename]) img = Image.open(destination) - img = img.resize(plat.sky) + img = img.resize(plat.now) # save and return image destination = "/".join([target, 'temp.png']) diff --git a/plat.py b/plat.py index f0275fc..a8322dc 100644 --- a/plat.py +++ b/plat.py @@ -1 +1,2 @@ -sky = (1000, 1500) \ No newline at end of file +sky = (1000, 1500) +now = (220, 340) \ No newline at end of file diff --git a/templates/processing.html b/templates/processing.html index 87e50c2..80c1623 100644 --- a/templates/processing.html +++ b/templates/processing.html @@ -58,8 +58,8 @@

Crop

Rotate

- - + +
From 085c449ad1011815e4face5bfbe0d76f6ea2890d Mon Sep 17 00:00:00 2001 From: leourl Date: Thu, 20 Feb 2020 17:24:08 +0000 Subject: [PATCH 3/3] Add gitpod config this commit adds support for Gitpod.io, a free automated dev environment that makes contributing and generally working on GitHub projects much easier. It allows anyone to start a ready-to-code dev environment for any branch, issue and pull request with a single click. --- .gitpod.Dockerfile | 10 ++++++++++ .gitpod.yml | 4 ++++ README.md | 2 ++ 3 files changed, 16 insertions(+) create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..bea40f0 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,10 @@ +FROM gitpod/workspace-full + +USER gitpod + +# Install custom tools, runtime, etc. using apt-get +# For example, the command below would install "bastet" - a command line tetris clone: +# +# RUN sudo apt-get -q update && # sudo apt-get install -yq bastet && # sudo rm -rf /var/lib/apt/lists/* +# +# More information: https://www.gitpod.io/docs/config-docker/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..daa8a83 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,4 @@ +tasks: + - init: pip install -r ./requirements.txt +image: + file: .gitpod.Dockerfile diff --git a/README.md b/README.md index a0ac0b6..e63ba4c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/gxercavins/image-api) + # Image API Image Processing API written in Python, using the Pillow library for image manipulation and exposing the functions with the Flask framework. The API has been tested with jpg, png and bmp formats and is able to flip, rotate and crop an image, as well as blending two images, either RGB or gray scale.