Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Lambda Image Resizing

Lambda Image Resizing

Lunch and Learn - April 2016

6b6afbaea3bf1de98975dedc5cd083c1?s=128

stevenjackson

April 21, 2016
Tweet

More Decks by stevenjackson

Other Decks in Programming

Transcript

  1. WE DON’T NEED NO STINKING SERVERS IMAGE RESIZING WITH AWS

    LAMBDA
  2. The Problem: For the last 6 years, users have been

    able to upload any image they like for use in a VizZle lesson 10144 × 8054 pixels 32.6 MB 980 DPI minutes to download
  3. And the app would never show it at that resolution!

    Max Page Size: 1920 x 1080 414x329 915x686 944x708
  4. Or the old app Flash “Card” Size: 520 x 390

  5. The Solution: Batch convert all the images! Max Image Size

    960x540 680x540 $ convert 1416855261.78270 -size x540
  6. “How many images are there anyway?” –Hey Blinken

  7. None
  8. None
  9. None
  10. “Are you going to download every one from the internet?”

    –Al Gore
  11. None
  12. None
  13. “What are we going to do with new uploads?” –Johnny

    Five
  14. None
  15. None
  16. “Who is going to maintain that EC2 instance?” –Jeff Bezos

  17. None
  18. None
  19. None
  20. None
  21. None
  22. None
  23. None
  24. None
  25. Or any binary compiled on Amazon Linux!

  26. None
  27. None
  28. None
  29. None
  30. None
  31. None
  32. None
  33. Read/Write S3 Role Type: AWS Lambda Attach Policy: AWSLambdaExecute

  34. None
  35. None
  36. Lambda Interface

  37. None
  38. None
  39. Deployment

  40. Configuration

  41. Testing

  42. Testing

  43. Testing

  44. Image Resizing Gotchas Maintain Aspect Ratios Lossy vs Lossless Lossy

    vs Headless Lambda Inception ACLs
  45. Image Resizing Gotchas Maintain Aspect Ratios Lossy vs Lossless Lossy

    vs Headless Lambda Inception ACLs
  46. Lambda Gotchas Function runtime is limited to 5 minutes Maximum

    of 1.5GB memory Debugging involves waiting for CloudWatch logs to show up
  47. “What else can we do with it?” –Jeff Bezos

  48. None
  49. None
  50. None
  51. None
  52. None
  53. None
  54. None
  55. None
  56. None
  57. None
  58. None