digitalinteraction / ongoingness-api

API for the Ongoingness Project
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Image Resizing Refactor #9

Closed wel-shy closed 5 years ago

wel-shy commented 5 years ago

Refactoring Image Resizing

Images to be resized when they are being requested, rather than when being stored. Full size images should be stored in S3, so they can be adjusted for the device making the request. Resizing should also take the orientation of the image into account, resizing by the smallest edge first and then cropping.

Possible Solution

Upload

  1. Store directly to S3

Request

  1. Pull from S3
  2. Find most interesting part of the photo with smartcrop.js.
  3. Crop with jimp using coordinates from smartcrop.
  4. Return resized image.