Social Meal - social application - Add user avatar

in #utopian-io3 years ago (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

Sort:  

Thank you for the contribution. It has been approved.

Is this feature already available on the Android App?
https://github.com/stramek/FoodShare

You can contact us on Discord.
[utopian-moderator]

Hey @eastmael, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

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

Congratulations @piach! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

The new SteemFest⁴ badge is ready
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.16
TRX 0.03
JST 0.025
BTC 12929.22
ETH 409.90
USDT 1.00
SBD 1.00