Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion course-04/exercises/c4-demos-master/10-udagram-app/package.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"elasticsearch": "^15.4.1",
"express": "^4.16.4",
"http-aws-es": "^6.0.0",
"jimp": "^0.6.1",
"jimp": "^0.22.12",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This major version upgrade of jimp from 0.6.1 to 0.22.12 introduces breaking changes that will affect src/lambda/s3/resizeImage.ts.

  1. Import Path: According to the jimp v0.17.0 changelog, the jimp/es entry point has been removed. The import import Jimp from 'jimp/es' will fail. It should be changed to import Jimp from 'jimp'.
  2. getBufferAsync method: According to the jimp v0.16.0 changelog, getBufferAsync no longer supports Jimp.AUTO. You must provide a specific mime type. Since the output file is a JPEG, you should use Jimp.MIME_JPEG. The line const convertedBuffer = await image.getBufferAsync(Jimp.AUTO) should be changed to const convertedBuffer = await image.getBufferAsync(Jimp.MIME_JPEG).

These changes need to be applied to src/lambda/s3/resizeImage.ts for the application to work correctly after this dependency upgrade.

"jsonwebtoken": "^8.5.1",
"middy": "^0.25.0",
"source-map-support": "^0.5.11",
Expand Down