-1

I am dealing with a problem. I want to download a gif and place text at the top for example add the text "Top text" on this gif.

I have looked through google codegrepper and stackoverflow for an answer but nothing

How would i accomplish that? Documentation would be appreciated.

  • 1
    @ShivenDhir personally i don't know. It's maybe because it had typos that's why i decided to edit it so i can post questions – Kārlis Kazāks Jan 18 '23 at 13:17
  • Maybe you could try adding a little more detail on code examples on what you have tried. If your problem is solved, adding a "solution" section to the bottom of the answer may improve the upvotes on the answer. Also, why have you linked to StackOverflow? – Sive Jan 18 '23 at 13:27
  • @ShivenDhir no idea. – Kārlis Kazāks Jan 18 '23 at 13:40
  • It's really not needed. Obviously someone on StackOverflow has the link to stackoverflow – Sive Jan 18 '23 at 13:49

1 Answers1

2

You can use tenorjs to fetch the GIFs. If you only want to use one certain GIF, you download that, and add that to your Files.

You can use something like text-on-gif to display text on the GIF.

Basic Usage of text-on-gif:

const textOnGif = require("text-on-gif");

(async function(){

    //get gif as buffer
    var gifBuffer = await textOnGif({
            file_path:"/path/file.gif", //path to local file or url
            textMessage:"custom message"
        });
    console.log(gifBuffer)

    //write gif as file
    await textOnGif({
        file_path:"/path/file.gif", //path to local file or url
        textMessage:"custom message",
        write_as_file:true,
        getAsBuffer:false,
        write_path:"path/gif-with-text.gif"
    });

})();
Christoph Blüm
  • 925
  • 1
  • 9
  • 23