+ if (physicalFile.path === destination) {
+ throw new Error('Sharp needs an input path different that the output path.')
+ }
+
+ const sharpInstance = sharp(physicalFile.path)
+ const metadata = await sharpInstance.metadata()
+
+ // No need to resize
+ if (metadata.width === newSize.width && metadata.height === newSize.height) {
+ await move(physicalFile.path, destination, { overwrite: true })
+ return
+ }
+
+ await remove(destination)
+
+ await sharpInstance