You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using the compress utility of this library when I found that this function tries to read any uploaded file, not just image files.
This results in error messages being produced like the following:
A simple fix would be as follows in serverless-galleria-util/index.js, but I'm not sure if it would mesh with the other utilities:
constrawKey=record.s3.object.key;constext=rawKey.split(".").pop();constgoodTypes=["jpeg","jpg","png"];if(!goodTypes.includes(ext)){console.log(`Skipping ${rawKey} as its file extension ${ext} is unsupported`)return;}
The text was updated successfully, but these errors were encountered:
It looks like jimp has a clear listing of the file types that it supports, so I could probably check the mime type of the file before reading it to confirm that it’s supported.
The thing is, that this set of libraries are focused on building an image processing pipeline. So my expectation is that users are putting images in. If they put in something that’s not an image, the first lambda to pick it up will crash and the file won’t be propagated into the next bucket. Adding something like this gives a possibly clearer error message, but the processing result is the same.
Adding something like this gives a possibly clearer error message
This is the main thing I'm looking for, but I completely understand if such code is deemed unnecessary. My issue was that AWS put some auxiliary stuff regarding cost metrics in the S3 bucket along with images, and the pipeline still tried to transform these .csv files and whatnot.
Hi!
I was using the
![image](https://private-user-images.githubusercontent.com/55369003/309349679-3ee6ae9f-4619-4f33-9290-5a1e898ccff5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDczMDMsIm5iZiI6MTczOTIwNzAwMywicGF0aCI6Ii81NTM2OTAwMy8zMDkzNDk2NzktM2VlNmFlOWYtNDYxOS00ZjMzLTkyOTAtNWExZTg5OGNjZmY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE3MDMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2MzY5NjBhOTZhZTI2NTFhMTIwMjE3NWM1NmIxMzU0YTM2NzQ3ODQ5MTc3MWEwMTI4M2QzNjBhZmFhNjBmOTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.u7sfFuW-yPm9H-sxPDuW8smBVJ3n46qva_gHmb2GDec)
compress
utility of this library when I found that this function tries to read any uploaded file, not just image files.This results in error messages being produced like the following:
A simple fix would be as follows in
serverless-galleria-util/index.js
, but I'm not sure if it would mesh with the other utilities:The text was updated successfully, but these errors were encountered: