telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.21k stars 5.2k forks source link

[Feature request ] Inline gif handling #8

Closed sullivanmatt closed 9 years ago

sullivanmatt commented 10 years ago

Hello! First, thank you for taking the time to create and maintain this client - I really enjoy using it.

One feature I would absolutely love to see is HipChat-style inline gif animation for attached photos. Likewise, if a URL for an image is posted (so a URL ending in jpg, png, gif, etc), auto-display that image inline. Perhaps the existing "Delete message" functionality could be employed to allow the user to hide/delete the image if they find it offensive.

I'd love to assist, but I'm a Python / C# guy and after tinkering for a while I couldn't make it happen. Thanks!

telegramdesktop commented 10 years ago

I am not getting images from urls, that appear in text edit, because it is not quite predictable, maybe Telegram user was not going to make a request to that url (and show himself that way), just wanted to send it in the encrypted message to someone -- and we, without worrying him, make this request to see, if it is an image and if we wan't to send it via Telegram. And of course we can't do that on receive of the url, then user just did nothing (received someones message), and Telegram without his actions does any http/https GET request it received -- it is not secure and user-friendly.

sullivanmatt commented 10 years ago

I understand the potential concern. What if this feature was opt-in only? I think that could definitely address the security concerns you mentioned above while providing a neat feature to users.

eirinnm commented 10 years ago

it is not secure and user-friendly.

It's not secure, but it is user-friendly. I only chat with my friends, and I would love it if image URLs were turned into thumbnails. I think it should be an option, just like it is with mail clients and Gmail.

JochemKuijpers commented 10 years ago

I would also like to see this feature. Even if I have to opt-in.

It would be better if the Telegram API would send something like a MIME-type with the received file, but that's not the case apparently.

telegramdesktop commented 10 years ago

It has mime type in documents. But it is two different approaches -- to load such image / gif before sending the message, so that actually send image / gif and all (including mobile) telegram clients will see it inside, or handle links inside text messages, which will work only in this client, but with any links from other apps as well.

I like the first approach more. But I am not sure about implementation details.

ScottRFrost commented 10 years ago

I was just about to add a feature request for this!

Please add support for embedded animated gif and / or webm.

I agree with on not auto-playing / auto-downloading linked images. That's a security / tracking concern.

idan commented 10 years ago

:+1:, gifs are a requisite part of my daily discourse.

drguildo commented 10 years ago

This is two feature requests:

Maybe it'd be a good idea to split them up. It'd be nice if you could add animated GIF support (when a user sends a file rather than pasting a link) as I can't see any security problem with it as you already display images that have been sent.

drguildo commented 10 years ago

The QMovie class seems to provide support for animated GIFs so hopefully it wouldn't be too difficult to add support for in Telegram D.

ScottRFrost commented 10 years ago

0.6.3 resolves this issue. If you attach a gif (as document not as photo) the receiver can click it in tdesktop and it plays inline.

This issue can be marked as closed unless you were planning on adding WebM / MP4 animations as well.

drguildo commented 10 years ago

Why as a document? That's very, very unintuitive.

Brawl345 commented 10 years ago

I really like this click to play feature. I hate GIFs...

JochemKuijpers commented 10 years ago

Click to play: Yes Display them as a document (suggesting it will be opened by something else than Telegram): No.

Please be consistent with the mobile app: A blurred static image with a play button.

cobalto commented 10 years ago

I'm okay with the way to show gifs actually implemented, but It could be easier to send them. while draging and droping an image from the browser (not the url or a local image) it should give the option to send as a file to be shown animated, now I can just send static.

If its a gif, it should be always send as a gif, not a static image.

ummjackson commented 9 years ago

Still think it'd be great for this to operate similarly to how Hipchat, Slack, everything else handles *.gif URLs... definitely make it opt-in via the options panel, but it's pretty core feature that's lacking to date.

eirinnm commented 9 years ago

Today I wanted to share a gif I found on the internet. I had to save it to my computer before I could send it, which isn't very convenient! I want to just paste the url and have it send an animated gif. On 22/11/2014 9:43 pm, "Jackson Palmer" notifications@github.com wrote:

Still think it'd be great for this to operate similarly to how Hipchat, Slack, everything else handles *.gif URLs... definitely make it opt-in via the options panel, but it's pretty core feature that's lacking to date.

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-64094693 .

killarny commented 9 years ago

:+1: for webm support as well

joshsleeper commented 9 years ago

+1 for this.

Surye commented 9 years ago

:+1: For webm as well

ianhyzy commented 9 years ago

I'd also like to just be able to paste a url and have the gif/webm sent

JochemKuijpers commented 9 years ago

Response to what @ianhyzy said: I think there should be a distinction between sending an image and a link to an image. You can preview it, but you should not hide the link. In some cases you actually want to communicate a link instead of an image.

ianhyzy commented 9 years ago

@JochemKuijpers Maybe this could be done with a dialogue similar to the two buttons that appear when you drag an image to send it in the UI?

Christilut commented 9 years ago

+1 for webm support (starting to become the new GIF standard)

elboletaire commented 9 years ago

What about APNG?

http://littlesvr.ca/apng/gif_apng_webp.html

JochemKuijpers commented 9 years ago

Telegram is not a media player, so I'd say we don't need support for exotic specifications like animated PNG.

By the way, those comparisons aren't really fair, as GIF is limited to a 256-colour palette. I'd like to see the same test with 24-bit color animations. My guess is that APNG and WebP will be much closer in filesize and Lossy-WebP will probably be smaller than both.

ianhyzy commented 9 years ago

APNG really isn't used anywhere and doesn't have as much support as .webm

On Tue, Jul 21, 2015 at 8:46 AM Òscar Casajuana notifications@github.com wrote:

What about APNG?

http://littlesvr.ca/apng/gif_apng_webp.html

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-123311168 .

eirinnm commented 9 years ago

@elboletaire that page compares APNG to animated WebP, but neither are widely-used formats; Chrome doesn't support either of them. The future of GIF definitely appears to be WebM, the video codec.

edit: on the topic of inline playback, the Android app now supports inline playback of GIF and GIFV URLs, so I think it's time TDesktop was brought up to parity.

elboletaire commented 9 years ago

Telegram is not a media player, so I'd say we don't need support for exotic specifications like animated PNG.

Then why use webm? Sorry but I can't get it. APNG is more closer to GIF than webm.

By the way, those comparisons aren't really fair, as GIF is limited to a 256-colour palette. I'd like to see the same test with 24-bit color animations. My guess is that APNG and WebP will be much closer in filesize and Lossy-WebP will probably be smaller than both.

Yes, I would like to see it too.

Thanks everyone for your super-fast-clarifications.

eirinnm commented 9 years ago

I'd say the majority of GIFs being made and shared today are clips from a video, so that's why it makes sense to use a video codec like WebM instead of an image format like APNG. And with the big sites like Imgur getting behind WebM, that's the format that we should be focusing on, IMHO.

JochemKuijpers commented 9 years ago

Then why use webm? Sorry but I can't get it. APNG is more closer to GIF than webm.

Because WebM is not an endangered species, as opposed to APNG and Animated WebP.

GIF isn't about lossless animations, it's just one of the first formats to bring animations to the internet. that's why it's popular. WebM is perfect for that since it allows much smaller files and has great support in many clients/browsers/etc.

GIF isn't lossless anyway, since you have to convert the animation to a (max.) 256-colour palette and you only have one bit for the alpha-channel.

I can see why you would want APNG, because it would be cool to support semi-transparent, high-quality animated pictures. I'd like that too. but these things take a lot of time. It's just not realistic to add support for these exotic formats :)

elboletaire commented 9 years ago

Because WebM is not an endangered species, as opposed to APNG and Animated WebP.

If they are in endangered is because nobody (like you guys) support them. Firefox has support for apng since my memory can remember.

I can see why you would want APNG, because it would be cool to support semi-transparent, high-quality animated pictures. I'd like that too. but these things take a lot of time. It's just not realistic to add support for these exotic formats :)

Yes! And doing that we could have transparently-animated stickers too.

I thought that someone started doing all the dirty job, but searching it now I can see it was just an apng assembler (I thought they also built some SDKs, but I was wrong..).

Anyway, I understand that the better is to use the most used format despite all my personal drawbacks :sweat_smile: .

Again, thanks for your responses :smile:

PS. Nice resource I've just found about this issue: https://metagif.wordpress.com/2014/12/29/lets-try-out-apng/

Innomen commented 9 years ago

I say tg should and could support any image or media format a browser does. It doesn't have to be a "media player."

"but these things take a lot of time"

I very seriously doubt that. 99% of apps are developed based on other apps. We're all standing on the shoulders of giants here and tg isn't the first chat app.

No one is writing in machine code from scratch. It can already parse X image formats. I see no compelling logical defense of it being exceptionally hard to expand the base of accepted/displayed images.

All the linux gallery/photo apps would seem to have code for displaying X formats. Recycling should be possible from somewhere. This isn't reinventing the wheel, this is basic drag drop media support which tg opened the door to. If a browser (among others) can do it then tg should be able to do it. All of which have open source examples.

FWIW webm is crazy popular on 4chan. Which like it or not is a sizable and valid chunk of Internet usage and culture. Not to mention all the forums.

I would say the issue is simply one of priority. Gifs and webm definitely need to be next unless it would be easier to implement the adoption of other formats.

I wouldn't be surprised if at some point it'll be easier for them to drop in some code from some other project, use it as a generic image decoder and suddenly tg supports like, everything.

JochemKuijpers commented 9 years ago

@Innomen FYI, my point about Telegram not being a media player wasn't as much about WebM as it was about APNG and animated WebP. I've yet to see my first animated WebP or APNG out in the wild.

Of course you can add a ton of codecs and media libraries to Telegram. The point is, that takes time that could be spend on more important features. It would also make Telegram slower, bigger, more demanding, etc. If that's what you want, go ahead and create a pull-request.

I'd rather have a fast and light-weight chat client with as much functional features as possible. And if someone were to send me some weird media file, I'll just open it in another program.

ianhyzy commented 9 years ago

.webms aren't just on 4chan, imgur has their gifv format which is just a webm (or h264). All gifs uploaded to imgur are auto converted to gifv now.

On Tue, Jul 21, 2015, 12:04 Jochem Kuijpers notifications@github.com wrote:

@Innomen https://github.com/Innomen FYI, my point about Telegram not being a media player wasn't as much about WebM as it was about APNG and animated WebP. I've yet to see my first animated WebP or APNG out in the wild.

Of course you can add a ton of codecs and media libraries to Telegram. The point is, that takes time that could be spend on more important features. It would also make Telegram slower, bigger, more demanding, etc. If that's what you want, go ahead and create a pull-request.

I'd rather have a fast and light-weight chat client with as much functional features as possible. And if someone were to send me some weird media file, I'll just open it in another program.

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-123403581 .

Innomen commented 9 years ago

"I'd rather have a fast and light-weight chat client..."

Yeah because stickers are mission critical. /smh

No one cares how big the app is. It's as meaningless as high score. Just ask steam and netflix and anything else that uses bandwidth constantly or downloads stuff or both. Apps are freaking tiny compared to the primary uses of pcs and smart phones these days.

What matters is utility.

Also, I entirely doubt expanded image/media support will lead to a human detectable hit to speed unless the code is sabotaged to create said delay.

Stop scolding us.

JochemKuijpers commented 9 years ago

I'm just giving my opinion like everybody else here. All I'm saying is, we can't have every format, so someone has to draw a line. Imo, WebM is okay, animated PNG or WebP just aren't used as much.

What kind of feature request do you think developers would work on? A: "Let's add inline GIF support because it's used quite frequently by these communities. Oh, and by the way, GIFs are being replaced by WebM so support for that would also be neat." vs B: "Let's add inline support for these hundred media formats. Here, I've seen them used in other media players too, they clearly exist!"

I'm guessing we all know the answer to that..

Yeah because stickers are mission critical. /smh

It's a feature I thoroughly enjoy. Certainly more than obscure media format support.

Let's focus our conversation on this specific feature request. If you want other media formats supported, I'd suggest to create a new ticket. I hope I clarified my argument(s). You're free to respond but I'll leave it at this.

Innomen commented 9 years ago

"I'm just giving my opinion like everybody else here. "

You're trying to scold people who don't share that opinion into silence. That's not what others here are doing.

"What kind of feature request do you think developers would work on?"

I don't care. If people want it, they have a right to ask. Period. Stop scolding them for it.

JoshStrobl commented 9 years ago

Came here to also state I would appreciate gif support. I'm not even saying gif files from the Internet, but even gifs sent as photos or documents (TIL discovered lack of gif support after dragging a gif in from a folder into desktop client). To me gifs help express emotion and add another element (sometimes amusement) to a conversation.

ianhyzy commented 9 years ago

Joshua, you can send inline gifs on desktop, but you have to send them as a file. This isn't clear, but it does work.

On Mon, Aug 3, 2015, 12:51 Joshua Strobl notifications@github.com wrote:

Came here to also state I would appreciate gif support. I'm not even saying gif files from the Internet, but even gifs sent as photos or documents (TIL discovered lack of gif support after dragging a gif in from a folder into desktop client). To me gifs help express emotion and add another element (sometimes amusement) to a conversation.

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127348128 .

JoshStrobl commented 9 years ago

@ianhyzy Ah, wasn't aware. Well, nice to know :smiley:

Innomen commented 9 years ago

"Joshua, you can send inline gifs on desktop"

Not really. You can either send it as a file, in which case they have to open it with a second app to see it animate, or you can send it as an image (drag drop) in which case it is a static first frame.

So I'm curious, what you mean by "inline." Like as opposed to what?

ianhyzy commented 9 years ago

If you send a regular animated gif (not webm) it will let you view it in telegram as an online gif.

On Mon, Aug 3, 2015, 13:35 Innomen notifications@github.com wrote:

"Joshua, you can send inline gifs on desktop"

Not really. You can either send it as a file, in which case they have to open it with a second app to see it animate, or you can send it as an image (drag drop) in which case it is a static first frame.

So I'm curious, what you mean by "inline." Like as opposed to what?

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127364367 .

JoshStrobl commented 9 years ago

Not really. You can either send it as a file, in which case they have to open it with a second app to see it animate, or you can send it as an image (drag drop) in which case it is a static first frame.

Seems pretty convoluted in that case.

ianhyzy commented 9 years ago

Yes, yes it is. Hopefully it can be changed.

On Mon, Aug 3, 2015, 13:38 Joshua Strobl notifications@github.com wrote:

Not really. You can either send it as a file, in which case they have to open it with a second app to see it animate, or you can send it as an image (drag drop) in which case it is a static first frame.

Seems pretty convoluted in that case.

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127365094 .

eirinnm commented 9 years ago

This isn't correct- clicking on the thumbnail will make it play inline. It's not obvious though.

On Mon, 3 Aug 2015 19:41 Ian Hyzy notifications@github.com wrote:

Yes, yes it is. Hopefully it can be changed.

On Mon, Aug 3, 2015, 13:38 Joshua Strobl notifications@github.com wrote:

Not really. You can either send it as a file, in which case they have to open it with a second app to see it animate, or you can send it as an image (drag drop) in which case it is a static first frame.

Seems pretty convoluted in that case.

— Reply to this email directly or view it on GitHub < https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127365094

.

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127365802 .

Innomen commented 9 years ago

"This isn't correct- clicking on the thumbnail will make it play inline. It's not obvious though."

All that happens for me when you click it is that it brings it forward and darkens the background (no animation) just like how it does with normal jpgs.

JoshStrobl commented 9 years ago

All that happens for me when you click it is that it brings it forward and darkens the background (no animation) just like how it does with normal jpgs.

Same. just tried it

eirinnm commented 9 years ago

To clarify, I meant when it's sent as a document. I get a thumbnail and a "open with" button. Clicking the thumbnail makes it play inline.

On Mon, 3 Aug 2015 19:48 Joshua Strobl notifications@github.com wrote:

All that happens for me when you click it is that it brings it forward and darkens the background (no animation) just like how it does with normal jpgs.

Same. just tried it

— Reply to this email directly or view it on GitHub https://github.com/telegramdesktop/tdesktop/issues/8#issuecomment-127367875 .

Innomen commented 9 years ago

Ahhh, true. Ok. That's pretty close, but i still say it should just send them like jpgs, except that when clicked they animate. No sending like a document, no sending like a jpg.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.