28

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()

3 Answers 3

32

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.

1
  • 4
    A true solution. Cheers 👍🏽 Commented Sep 17, 2020 at 17:09
9

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).

2
  • 1
    I just realized that this whole gif feature appears only to work if you use one of the GIF menu's (such as video -> gif or the gif tab in emoji's). This is a very weird feature to me. But this solution works, yes, thanks!
    – JBrouwer
    Commented Mar 28, 2018 at 18:56
  • @JBrouwer and not on all phones. Only where UI considers .gif to be a video. a common browser, especially desktop one, considers its MIME as picture and Whatapp recode it, taking only first frame. Rest of the file is lost. Consequently it cannot play new gif format at all (because it's a mpeg inside). THey really didn't thought of it, just slapped features together with "it works" mentality. Commented Mar 17, 2023 at 8:49
4

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à!

2
  • 2
    How do you send to yourself. And how do you send asfile and not a photo? And where did you "open it in the phone"?
    – Rajib
    Commented Jun 13, 2020 at 13:58
  • ..ad on which phone. THose all are contextual. But the root of problem is: if .gif sent as image, it go only first frame in end, because file gets re-coded by CMS. Commented Mar 17, 2023 at 8:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.