Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't whatsapp play all gifs?

Tags:

gif

whatsapp

lua

gd

When I create a gif, which works fine in Chrome, I cannot make it play in WhatsApp. It just shows a static image.

To give an example, I am using lua with the lua-gd package to draw gifs. Even the example code given, which gives a nice gif of an enlarging circle, doesn't play on WhatsApp. Note that my version of WhatsApp can view gifs just fine (for example those sent via web WhatsApp using Giphy gifs).

Here is the gif:

gif

This is generated by the following example code by lua-gd:

require "gd"

im = gd.createPalette(120, 120)
assert(im)

black = im:colorAllocate(0, 0, 0)
blue = {}
for i = 1, 20 do
  blue[i] = im:colorAllocate(0, 0, 120+6*i)
end

fp = io.open("out.gif", "w")
assert(fp, "Failed to open file for writting")

fp:write(im:gifAnimBeginStr(true, 0))

for i = 1, 20 do
  tim = gd.createPalette(120, 120)
  tim:paletteCopy(im)
  tim:arc(60, 60, 6*i, 6*i, 0, 360, blue[21-i])
  fp:write(tim:gifAnimAddStr(false, 0, 0, 5, gd.DISPOSAL_NONE))
end

fp:write(gd.gifAnimEndStr())
fp:close()
like image 523
JBrouwer Avatar asked Jun 11 '17 14:06

JBrouwer


3 Answers

Most of the time it happens while we share gif through computer. Try to save created GIF file in your mobile device and share direct from mobile app. It worked for me every time.

like image 192
TheSEOGuy Avatar answered Nov 09 '22 00:11

TheSEOGuy


WhatsApp doesn't support sending GIFs directly, but I just found a workaround.

Send it as a video, open it on your phone, share it and select GIF there (in the top right corner on Android).

like image 37
AdB Avatar answered Nov 08 '22 22:11

AdB


Managed to solved it this way:

  1. Got the GIF in my computer

  2. The GIF was sent to myself as a file (not a photo), using WhatsApp web

  3. Downloaded & opened it in the phone.

Voilà!

like image 3
A Koscianski Avatar answered Nov 08 '22 23:11

A Koscianski