Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code after meeting - 310522 #15

Open
wants to merge 18 commits into
base: v7
Choose a base branch
from

Conversation

aurelien45100
Copy link

No description provided.

Co-authored-by: Callista Spiteri
Updated the link of the images that were not correct.
Updated the README, linked to the pull request Hypertopic#14, in order to change the first method.
Via the aws extensions in vscode, the code present on the internet was downloaded locally in order to add the dependencies that were necessary.

Co-authored : @callistas
Update the README.md in order to follow the modification of the code on AWS. 

The getAttributes function has been updated in order to lower the number of code lines and make the response clearer by suppressing the redundance of information.
Updated the README.md in order to add the optimized line in the json response.
Via the aws extensions in vscode, the code present on the internet was downloaded locally in order to add the dependencies that were necessary.

Co-authored : @callistas
Added the "StorageClass" parameter in the object used for the putObject functions (Thumbnail and Optimized) in order to change the storage class of the added s3 object.

Co-authored : @callistas
The function get the an item from a hash provided in path parameters.

If the optimized cell is empty for a given hash, it means that the optimized image isn't generated yet. We generate it and send it to the user as an image. We also update the DynamoDB item.

If the optimized image is already generated, we just send it to the user.

Co-authored : @callistas
We now verify the image type and only accept the ones that are allowed by the sharp module.

We added the optimized and the baseUrlAWS data in the DynamoDB item in order to know if an optimized image was already generated and to keep the url of aws dynamically given when an image is created (depending the bucket name).

Co-authored : @callistas
We now create the response, optimized and the thumbnail keys in the JSON object because those attributes were erased from the DynamoDB table, considered useless due to the presence of other attributes that allow us to recreate them with concatenation (baseUrlAWS, corpus and name).

Co-authored : @callistas
We verify if the optmized picture is already generated, if not, we generate it.

We return the image to the user.

Co-authored : @callistas
Based on the getOptimizedPicture, the getThumbnailOfImage function verify the presence of the thumbnail image, if it's not created yet, we do it.

Otherwise, we just send the image to the user.

Co-authored : @callistas
We now get the metadata of the image, especially the "DateTimeOriginal" via the "exif" module.

.gitignore was also updated to avoid the presence of the vscode file.

Co-authored : @callistas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant