Browse Source

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: 48e5be302539321726c8bc8d8539d685c807aea3
pull/17/head
LaurentiuMM 12 years ago
parent
commit
0fea3dd0bd
  1. 4
      src/ImageProcessor/ImageFactory.cs

4
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.

Loading…
Cancel
Save