QutEcoacoustics / baw-server

The acoustic workbench server for storing and managing ecoacoustic data. Manages the structure and audio data. Provides an API for clients access.
Apache License 2.0
9 stars 4 forks source link

Image Input Handling #446

Open Allcharles opened 4 years ago

Allcharles commented 4 years ago

Missing the ability to create a project/site, or update an existing project/site, with an image input. This image input could potentially be achieved by setting Content-Type to a Mime Multipart or similar type. Currently the route potentially accepts only base64 encoding?

Routes:

atruskie commented 3 years ago

Ok so regions are fully implemented and tested. See https://github.com/QutEcoacoustics/baw-server/commit/2d6a1408fc47e4886443232f981691d06937da24 . See also #497 .

Particularly these specs describe the way in which images can be sent to the API: https://github.com/QutEcoacoustics/baw-server/blob/2d6a1408fc47e4886443232f981691d06937da24/spec/helpers/shared_examples/a_route_that_stores_images.rb

There is no ideal method for sending an image and a record in one request.

Note: we're never going to transmit a multi-megabyte image as base64. just wipe that idea clean out of the realm of possibilities.

Next steps are to ensure project/site pass the same suite of tests as region.

However, the basic process should still allow uploads today - the old site supported it. I'd recommend the two step approach (upload JSON model via API, upload image second as form multipart).

atruskie commented 3 years ago

For reference: