- await processImage(previewPath, thumbnailPath, size, true)
+
+ const oldPath = thumbnail.getPath()
+
+ // Update thumbnail
+ thumbnail.filename = generateImageFilename()
+ thumbnail.width = size.width
+ thumbnail.height = size.height
+
+ const thumbnailPath = thumbnail.getPath()
+ await processImage({ path: previewPath, destination: thumbnailPath, newSize: size, keepOriginal: true })
+
+ // Save new attributes
+ await thumbnail.save()
+
+ // Remove old thumbnail
+ await remove(oldPath)
+
+ // Don't federate, remote instances will refresh the thumbnails after a while