Are you trying to add an animated GIF? Recent discussions on this Forum have suggested that animated GIFs are not well received in iNaturalist observations and are discouraged, at least by a part of the iNat population (including me). I don’t think there are any prohibitions for animated GIFs but they elicit diverse and conflicting opinions.
If that (animated gif) is the case I’d suggest putting the short clip on a Peertube instance (or YouTube if you trust them) and then linking to it in the description.
GIF upload is very finnicky. Generally larger ones won’t work. Smaller ones may require multiple attempts or there may be something about a specific file that the uploader doesn’t like - try resizing it slightly or some other minor edit.
I’ve never had problems uploading animated gifs before, and I’ve uploaded some that are very close to 20 MB (although, granted, they do take awhile to upload). For this specific gif I’ve made it, cropped it, and optimized it at least twice, and waited a couple weeks before trying again.
I’ve only ever done the 1st option. I’ll try the 2nd and see if it works.
I don’t know how you’re generating your gifs. If you’re not using GIMP (GNU Image Manipulation Program), then try it out. It’s free :-) Download the package for your OS.
Then open the gif in GIMP.
You may get an error message at the bottom that a frame or two is corrupted, which may be the problem. Gimp just leaves those frames out.
Then click on File → Export as…
Choose gif under File type
Click on animated and leave the rest of the settings as is
Rename the file so that it’s different to the original
Gimp will then save as animated gif, which takes a while.
You’ll see a window come up that says “Delay inserted to prevent evil CPU sucking resources” - just click OK.
Try uploading the new gif.
I have not had any problems uploading gifs since I started using Gimp. Though I had loads of problems before when using other processes.
I’ve had the same error in the past with a .gif file I generated on my Samsung phone.
My workaround was uploading my video file to https://ezgif.com/ and generating the .gif file from there instead.
Additionally I assume you could upload your already generated .gif and make some change to it on that same site, then try upload the new modified output version to iNat