empowerhack / DrawMyLife-Service

API and Admin system for the Draw My Life initiative - Volunteers: check README and GitHub Projects to get started.
https://github.com/empowerhack/DrawMyLife-Service/projects
MIT License
13 stars 0 forks source link

[#86] Add extra image validation #92

Closed krissy closed 7 years ago

krissy commented 7 years ago

_Addresses backend component of #86_

What this does

Validation on upload attempt of unsupported format:

screen shot 2016-08-21 at 14 56 55

Green placeholder preview when tiff uploaded (not yet converted to jpg):

screen shot 2016-08-21 at 16 56 38
steverabino commented 7 years ago

:+1: :+1: :+1:

CathMollie commented 7 years ago

@krissy Just noting tiff upload wasn't very successful in usability test - took a long time and displayed as broken link on 'manage drawings' page.

steverabino commented 7 years ago

Good save @CathMollie, Kris is going to do some conversion magic!

krissy commented 7 years ago

@CathMollie good to know! Tanya just tested and you're right. Steve found this could be an existing issue with the file management tool we're using so working on a fix as part of this branch.

krissy commented 7 years ago

Tiff issue fixed in 11e5bfc - please review. Now all images will be converted to jpgs going forward

steverabino commented 7 years ago

FYI @krissy for tiff, the preview isn't working; I guess the image hasn't been converted by this point.

Is there a way to do the conversion before showing the preview; or shall we not worry about this for now?

image

krissy commented 7 years ago

TIFF preview addressed in 39aedc3 and screenshot added to PR description. Browsers don't support TIFFs without a hacky js library, and images aren't saved (and thus converted to jpegs) until the drawing is saved. So for TIFFs we'll show an alternate green placeholder to indicate change.

On a side note, we need a separate ticket to add some client-side validation for supported image formats. E.g. if PDF upload attempted, we show a red cross placeholder and appropriate validation message reminding user about supported formats.

steverabino commented 7 years ago

:+1: Nice work - sorry I found the bug :(