From 78aaf7d8599288b9cddca027a24db25911fe77e4 Mon Sep 17 00:00:00 2001 From: LaurentiuMM Date: Tue, 10 Jun 2014 12:55:52 +0300 Subject: [PATCH] Fix for allowing the current cache to properly work with images which does not have the same internal format and extension (e.g. PNG internal format and .JPG extension). Former-commit-id: da921bbe90fbf548ec7db7d8f2152d5049ee46e6 --- src/ImageProcessor/ImageFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageProcessor/ImageFactory.cs b/src/ImageProcessor/ImageFactory.cs index b88c3d3bf..4db12e3f7 100644 --- a/src/ImageProcessor/ImageFactory.cs +++ b/src/ImageProcessor/ImageFactory.cs @@ -860,9 +860,9 @@ namespace ImageProcessor int length = filePath.LastIndexOf(".", StringComparison.Ordinal); string extension = this.ImageFormat.GetFileExtension(this.OriginalExtension); - if (!string.IsNullOrWhiteSpace(extension)) + if (length == -1) { - filePath = length == -1 ? filePath + extension : filePath.Substring(0, length) + extension; + filePath = filePath + extension; } // Fix the colour palette of indexed images.