Social Meal - social application - Add user avatar

avatar
(Edited)

New Features

Upload avatar

In this contribution I focused about possibility to upload own avatar. Users have now possibility to add their avatar, this avatar is displaying in their profile and also as their thumbnail in the events which their participated or will be participate. Image is saving on the server and in database is stored information about localization. We dont want to store a full image, because it required a lot of space, so we create a thumbnail from photo, thumbanils is much smaller but quality i very good. User can also update his avatar, after update his old photo is deleted.

screenshot from swagger with this method:

image.png

Implementation

pull request:

image.png

commit connected wit this contribution

Implementation contain :

  • creating new service: ImageService, witch has couple of methods, main methods is responsible for take a photo as stream. Then is checking if photo has correct format, I decided also to check a EXIF orientation parameter, because photos made by Samsung Galaxy are often rotated, and if I will save it in original way, they will be displaying in application incorrectly. The rest of the methods are responsible for read image size, resizing, delete old photos and validate image format
  • methods in profileService witch are responsible for update particular user information about path to his avatar,
  • method in ProfileController to get avatar by Put method and return the path to user avatar.

Links related to this contribution



Posted on Utopian.io - Rewarding Open Source Contributors



0
0
0.000
4 comments
avatar

Hey @piach I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

0
0
0.000