こんにちは。フォトウエディングの撮影スタジオ検索サイト「Photorait(フォトレイト)」を担当しているエンジニアの武田(@takedajs)です。 Photorait(フォトレイト)では入稿された画像をリサイズしてから保存し、公開側に合った大きさの画像を表示しています。動的に画像をリサイズする機能をまだ導入していないので、検証も兼ねて実装してみました。 Lambda、API Gateway、ImageMagickを利用した画像リサイズ機能を書いた記事が過去に投稿されていますが、今回の記事では、Lambda@Edgeとsharpを利用した画像リサイズ機能の実装について書きました。 やってみよう!AWSでWEBサーバー環境構築(Lambda|API Gateway|シリーズ第4回) 実装したもの このような構成で画像リサイズ機能を実装しました。 クライアントがwidthとheightのパラ