1import GIF from 'gif.js'; 2 3export default function MyGifCreator() { 4 const createGif = () => { 5 const gif = new GIF({ 6 workers: 2, 7 quality: 10, 8 workerScript: '/gif.worker.js', // â Path to the public file 9 }); 10 11 // Add a frame (example) 12 const canvas = document.createElement('canvas'); 13 const ctx = canvas.getContext('2d'); 14 ctx.fillStyle = 'red'; 15 ctx.fillRect(0, 0, 100, 100); 16 17 gif.addFrame(ctx, { copy: true }); 18 19 gif.on('finished', function (blob) { 20 const url = URL.createObjectURL(blob); 21 console.log('GIF ready:', url); 22 }); 23 24 gif.render(); 25 }; 26 27 return <button onClick={createGif}>Create GIF</button>; 28}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.