We're looking for anyone interested in helping contribute this improvement.
If you're interested please comment here or come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team.
Currently custom emojis have a very small size limit (64 KB, 128x128 pixels).
For improved usability, allow users to
Some tips for anyone who would like to work on this:
You can use the code for creating file thumbnails as a reference point for this. Some additional things to consider though are:
resize.Thumbnail
to do it for you.gif.DecodeAll
to get the individual frames, resize them down, and then put them back together using gif.EncodeAll
.Hi, I'd like to give it a try.
Sweet, highly appreciated @iraquitan!
Hello, please also make sure this works for gifs! :) <3
Hey @iraquitan, thank you for working on this improvement, highly appreciated!
Just wanted to give you a heads up about upcoming dates for our 3.5 release that are relevant to this improvement:
If you'd like to work on getting the proper custom emoji scaling added for 3.5, those would be the dates to meet -- just wanted to let you know so it doesn't come as a surprise if you were aiming for the 3.5 release.
Once again, big thanks for your help, really excited for this improvement!
Hey @iraquitan , just checking how you're doing here -- let us know if there's any tips we can provide?
Hi @jasonblais, sorry the delay, I was kinda busy. Yes, you can provide me some tips. I think I misunderstood how this should work. I was trying to resize the image on the fly, so I was finding some difficulty in decoding the image bytes into the Image object itself so I can use in a function like in generateThumbnailImage
function. But I think the correct way to do this is to first upload the image and then get and resize the image to store again. Am I wrong? Also, what MaxEmojiFileSize
should I use?
Hi @iraquitan,
I'd expect the file to be resized when it's saved to the server in uploadEmojiImage. Once it's loaded into buf
, you can copy it into a []byte
by calling buf.Bytes()
and then do whatever you need with the raw bytes. In this case, you'll be getting the image dimensions from image.DecodeConfig
and then if it's between the current max dimensions and the MaxImageSize
, you'll use image.Decode
to get it into a format that the image resizing library can deal with. You'll still need that special handling of animated gifs as mentioned above, but it'll be a similar process.
If you've got any questions about this, feel free to let me know
What about the ability to not scale down to system-default size as well? I'm all for uniformity of emoji size, but I like the idea of having some "huge" ones as well.
@knalb You can use existing markdown formatting to display larger images in messages.
Example:
I am aware of that markdown functionality. I was actually thinking of the
ability to have the emoji displayed in the native resolution for the image,
whatever that is. For example, if I upload a 550x850 image of
RANDOM_THING, I'd like that to be displayed without resizing at all,
similar to how the image preview works now when you paste in a url. I
imagine this as an option available at the time of creation/upload of the
emoji, to differentiate it from "normal" size.
On Fri, Nov 4, 2016 at 5:02 PM, Jason Blais [email protected]
wrote:
@knalb https://github.com/knalb You can use existing markdown
formatting to display larger images in messages.Example:
[image: image]
https://cloud.githubusercontent.com/assets/13119842/20025054/394468be-a2c1-11e6-9750-0ee159fbfb71.png—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mattermost/platform/issues/4235#issuecomment-258568391,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGKPUgDAzyqo-mYF-GEFxiV2Y6ZC2YVhks5q67mVgaJpZM4KYobE
.
Thanks @knalb, appreciate your feedback.
Would you like to contribute this in the feature idea forum so it can be discussed, upvoted and considered for a ticket accepting pull requests?
Please include a link back to this GitHub Issue. If you're interested in implementing, please say so and we'll prioritize the review.
You get 10 votes in the feature idea forum, and each one influences the future of the project.
Closed via #4447
Most helpful comment
I am aware of that markdown functionality. I was actually thinking of the
ability to have the emoji displayed in the native resolution for the image,
whatever that is. For example, if I upload a 550x850 image of
RANDOM_THING, I'd like that to be displayed without resizing at all,
similar to how the image preview works now when you paste in a url. I
imagine this as an option available at the time of creation/upload of the
emoji, to differentiate it from "normal" size.
On Fri, Nov 4, 2016 at 5:02 PM, Jason Blais [email protected]
wrote: