mbari-org / SeafloorMappingDB

Make MBARI seafloor mapping datasets more accessible and useful
GNU General Public License v3.0
3 stars 6 forks source link

Download a full-rez version of the thumbnail_image #76

Open MBARIMike opened 2 years ago

MBARIMike commented 2 years ago

From the Use Case document:

View a JPG thumbnail map made from each mission’s ZTopo.grd from the query results page, and download a full-rez version.

The database already stores a 1/4 resolution version of the thumbnail map. For this Issue we just need to provide the download a full-rez version feature.

jbpaduan commented 2 years ago

Can the thumbnail or full-rez images be forced to display in landscape if that's the orientation of the image? Landscape views now rotate 90-degrees into a portrait view.

jbpaduan commented 2 years ago

Partial fulfillment of this issue could be accomplished if the user was able to download the 1/4 resolution version stored in the database.

MBARIMike commented 2 years ago

A lot of possibilities open up if we can mount the SeafloorMapping share onto a volume that can be exposed over https.

We'd need to add an nginx container to the deployment and figure out how to proxy it through traefik. (Boy, that's quite a bit of nerd jargon in one sentence! :-)

MBARIMike commented 2 years ago

This blog post describes how this may be done: https://www.simplecto.com/use-traefik-with-nginx-apache-caddyserver-serve-static-files/

MBARIMike commented 2 years ago

This PR makes the SeafloorMapping share available over HTTP in the debug.yml and local.yml deployments. The production.yml deployment is more challenging as traefik is used as the proxy server and I'm struggling to figure out how configure a route to the nginx static file server. The online documentation and blog posts have been incomplete and somewhat scattershot, and quite frustrating for me to get working.

I'm considering removing traefik from production.yml (it was put there by cookiecutter-django, primarily because of the ease of using letsencrypt - which we aren't using anyway) and using nginx for both proxy and static file serving. This also gives the option of replacing S3 with on-premises media file storage, simplifying access for VPN users.

MBARIMike commented 2 years ago

Almost done with this and I've decided that this was not a good first issue to tackle.

MBARIMike commented 2 years ago

The last PR has been pulled to production. There is now a new entry under the thumbnail image in the detail views for Missions and Compilations (the thumbnail image on the page is also hyperlinked to the full rez image):

View full resolution image: URL to the image

Note that most all of the Compilation images are .tif files which will be downloaded rather than being rendered in the browser.

jbpaduan commented 3 months ago

Re previous comment, somehow the .tif files are being rendered in a browser, as on https://smdb.shore.mbari.org/compilations/2022-southerngoc-figureslass-southpescaderovents_mauv_topo1m/

jbpaduan commented 3 months ago

This issue can be closed.

jbpaduan commented 3 months ago

Hah! I appear to be able to close issues!