+ // Use FFmpeg to process GIF
+ if (extension === '.gif') {
+ await processGIF(path, destination, newSize)
+ } else {
+ await jimpProcessor(path, destination, newSize, extension)
+ }
+
+ if (keepOriginal !== true) await remove(path)
+}
+
+// ---------------------------------------------------------------------------
+
+export {
+ generateImageFilename,
+ processImage
+}
+
+// ---------------------------------------------------------------------------
+
+async function jimpProcessor (path: string, destination: string, newSize: { width: number, height: number }, inputExt: string) {
+ let jimpInstance: Jimp
+ const inputBuffer = await readFile(path)