vwbusguy / beefy-connection

A kiosk for connecting with potential contributors and following up from event contacts.
GNU General Public License v3.0
0 stars 9 forks source link

Store image as jpg rather than png #32

Open jdeisenberg opened 9 years ago

jdeisenberg commented 9 years ago

I haven't tested this, but I changed the MIME type of the data to image/jpeg; that should consume less space than a PNG.

vwbusguy commented 9 years ago

I'm going to put this on hold for now. It'll take some more testing due to some server side hackery to get png to work from dataurl.

vwbusguy commented 9 years ago

The default resolution of the image is so small, I think this would probably be trivial to most any case, however, I'm entirely open to adding features to this. Rather than substituting png for jpeg, I'd much rather code a handler for both.

Currently, there's a bit of nonsense in the Python end to get png to work. It strips out the "dataurl" portion and terminates the end of it. This makes it work for png in the current Firefox with out getUserMedia() implementation, but could probably be more robust with some more regex magic.

We could easily enough detect png/jpg in the current python handler, but would need a way to let the front-end know. We could write an ajax handler for that, but adding an optional template parameter that we could pass to the javascript (an html5 data attribute on the screenshot div, for example) would be the most efficient.

If you'd rather stick to javascript, I can handle the python, but it would probably be best to work on it in a new branch and merge it in so we don't intentionally break master in the meantime.