+async function downloadImage (url: string, destDir: string, destName: string, size: { width: number, height: number }) {
+ const tmpPath = join(CONFIG.STORAGE.TMP_DIR, 'pending-' + destName)
+ await doRequestAndSaveToFile({ method: 'GET', uri: url }, tmpPath)
+
+ const destPath = join(destDir, destName)
+ await processImage({ path: tmpPath }, destPath, size)
+}
+