USGS-WiM / STNServices2

Web services for the Short-Term Network (STN) database
Other
0 stars 0 forks source link

s3 lambda script to create thumbnail and preview versions of all photo uploads #123

Open troddick opened 7 years ago

troddick commented 7 years ago

We need the lambda scripting added to stn2storage and stn2storagetest s3 buckets to create a thumbnail version and a preview version whenever a photo file is uploaded to s3 (in addition to the original size for downloading). Let me know if you need any more detailed information on this. This is what we discussed at the Summit.

Thanks

aaronstephenson commented 7 years ago

I think we could go two ways with this. The basic AWS example requires two buckets to avoid an infinite loop of event triggers. Alternately, we could create an API that you can call as needed, and still post to the original bucket.

troddick commented 7 years ago

The end result is that we have 2 separate applications (the STN Photo Viewer and STNWeb) that will need to access 3 separate file sizes (thumbnails for an initial view or within a carousel, a middle size for preview, and original size for download). Right now, all of these are being obtained via an endpoint in stnservices to getItem that has a connection to the s3 bucket and returns the stream and the browser handles showing the image. (Being that it's the end of the day) I haven't fully read the API option thoroughly, but I'm thinking the easiest way would be to access the other bucket in our stnservices to getItem and return the other sizes -- would that mean 3 buckets in total (original, preview, thumbnail? -- (depending on which they are wanting). Which option would you recommend?