diff --git a/Guide/file-storage.markdown b/Guide/file-storage.markdown index 844658404..e3b66a48a 100644 --- a/Guide/file-storage.markdown +++ b/Guide/file-storage.markdown @@ -869,6 +869,7 @@ import Web.Controller.Prelude import IHP.ControllerSupport import System.Directory (doesFileExist) import qualified Data.Text as Text +import qualified Data.UUID as UUID (fromText) instance Controller ImageStyleController where action RenderImageStyleAction { width, height, originalImagePath } = do @@ -891,6 +892,8 @@ instance Controller ImageStyleController where let options :: StoreFileOptions = def { directory = imageStylePathDirectory , preprocess = applyImageMagick "jpg" ["-resize", cs size <> "^", "-gravity", "center", "-extent", cs size, "-quality", "85%", "-strip"] + -- Keep the original filename. + , fileName = UUID.fromText uuid } storedFile <- storeFileFromPath (cs $ storagePrefix <> originalImageDirectory <> "/" <> uuid) options