gbif / portal16

GBIF.org website
https://www.gbif.org
Apache License 2.0
24 stars 15 forks source link

Sign image cache URLs #1851

Closed MattBlissett closed 1 year ago

MattBlissett commented 1 year ago

I've updated the documentation to reflect the new version of Thumbor.

https://github.com/gbif/portal16/blob/master/image_caching.md

Could we update the portal to use the new API for occurrence requests (i.e. https://api.gbif.org/v1/image/cache/occurrence/2005380410/media/568639b65b65ddb9090d3d6ef1abce14) and — lower importance — sign requests for non-occurrence image requests through Thumbor.

MortenHofft commented 1 year ago

The link doesn't work https://api.gbif.org/v1/image/cache/occurrence/2005380410/media/568639b65b65ddb9090d3d6ef1abce14 for me Is there anything I need to know?

And how does sizing and other params work? where should they be insterted? E.g. fit-in/500x

MortenHofft commented 1 year ago

With the way we currently get data and display images it is a bit tricky to start signing them. Simply because we query the API directly from the browser, for, e.g. species images. Or contentful. And then choose what scale to display them in the browser. Obviously it would be possible to have the server generate the signed urls in the appropriate sizes etc, but it just isn't how things work now. So I would think it requires considerable more work than simply changing the occurrence URLs

MattBlissett commented 1 year ago

99% of what's needed is the occurrence images, and it looks to be working properly there.