From 4cebfacdaaa9f4f1673f10e1e6be4a90a2184217 Mon Sep 17 00:00:00 2001 From: rahulgurnani Date: Tue, 8 Oct 2019 10:09:40 +0530 Subject: [PATCH 1/6] Fix #112: Allow mimetypes that OS recognizes --- autofocus/predict/app/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autofocus/predict/app/app.py b/autofocus/predict/app/app.py index 27e8cd4..f521234 100644 --- a/autofocus/predict/app/app.py +++ b/autofocus/predict/app/app.py @@ -1,3 +1,4 @@ +import mimetypes import os import time from zipfile import ZipFile @@ -10,7 +11,7 @@ # We are going to upload the files to the server as part of the request, so set tmp folder here. UPLOAD_FOLDER = "/tmp/" -ALLOWED_EXTENSIONS = set(["png", "jpg", "jpeg", "gif", "bmp"]) +ALLOWED_EXTENSIONS = set(k for k, v in mimetypes.types_map.items() if v.startswith('image/')) app = Flask(__name__) app.config.from_object(__name__) From 0a194843265c7975d5d315bb7d784686f136c5f0 Mon Sep 17 00:00:00 2001 From: rahulgurnani Date: Tue, 8 Oct 2019 19:25:43 +0530 Subject: [PATCH 2/6] Reformat code --- autofocus/predict/app/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autofocus/predict/app/app.py b/autofocus/predict/app/app.py index f521234..ce7825b 100644 --- a/autofocus/predict/app/app.py +++ b/autofocus/predict/app/app.py @@ -11,7 +11,9 @@ # We are going to upload the files to the server as part of the request, so set tmp folder here. UPLOAD_FOLDER = "/tmp/" -ALLOWED_EXTENSIONS = set(k for k, v in mimetypes.types_map.items() if v.startswith('image/')) +ALLOWED_EXTENSIONS = set( + k for k, v in mimetypes.types_map.items() if v.startswith("image/") +) app = Flask(__name__) app.config.from_object(__name__) From 956740016e7dd573b4ef67658f47767e3ff61adc Mon Sep 17 00:00:00 2001 From: gsganden Date: Tue, 8 Oct 2019 16:55:49 -0500 Subject: [PATCH 3/6] Create branch From a0fcc296e742f5f4ee2452dcc537ee652dc2c1c7 Mon Sep 17 00:00:00 2001 From: Brian Burns Date: Wed, 16 Oct 2019 19:38:01 -0500 Subject: [PATCH 4/6] just an old url --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 985abda..4dd63dc 100644 --- a/setup.py +++ b/setup.py @@ -31,6 +31,6 @@ extras_require={"dev": regular_packages + dev_packages}, author="Greg Gandenberger", author_email="gsganden@gmail.com", - url="https://github.com/UptakeOpenSource/autofocus", + url="https://github.com/uptake/autofocus", long_description_content_type="text/markdown", ) From 8ac8bc050db06784aee4f9f32f43d5878c498a07 Mon Sep 17 00:00:00 2001 From: gsganden Date: Thu, 17 Oct 2019 06:13:40 -0500 Subject: [PATCH 5/6] Refine PR template --- .github/pull_request_template.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 18eee65..8a0bf78 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,7 @@ Feel free to open a PR before all of these items have been completed. Pull Request Checklist + - [ ] Pull request has been made against `dev` branch. - [ ] Pull request includes a description of the change and the reason behind it. - [ ] Pull request [uses keywords](https://help.github.com/en/articles/closing-issues-using-keywords) to close relevant [issues](https://github.com/uptake/autofocus/issues). - [ ] Pull request includes unit tests for any new functionality. @@ -11,4 +12,4 @@ Maintainer's responsibilities: - [ ] `_version.py` has been updated. - [ ] `CHANGELOG.md` has been updated. - [ ] Updated app container has been pushed, if relevant, with current version number. -- [ ] App container version number has been updated in README. +- [ ] App container version number has been updated everywhere in README. From 555758ece9f3e483b55d3ee5e52f9f521d6ea2b2 Mon Sep 17 00:00:00 2001 From: gsganden Date: Thu, 17 Oct 2019 06:14:19 -0500 Subject: [PATCH 6/6] Bump version --- CHANGELOG.md | 4 ++++ autofocus/_version.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30f2432..5e523b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). +# [1.2.4] - 2019-10-13 +### Changed + - Service gets image file extensions from `mimetypes` instead of using a hard-coded list. + # [1.2.3] - 2019-8-22 ### Changed - Tests and instructions now refer to "localhost" instead of "0.0.0.0". diff --git a/autofocus/_version.py b/autofocus/_version.py index bc86c94..b3f9ac7 100644 --- a/autofocus/_version.py +++ b/autofocus/_version.py @@ -1 +1 @@ -__version__ = "1.2.2" +__version__ = "1.2.4"