File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/ImageProcessor.Web/HttpModules Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ namespace ImageProcessor.Web.HttpModules
21
21
using System . Web ;
22
22
using System . Web . Hosting ;
23
23
24
+ using ImageProcessor . Imaging . Formats ;
24
25
using ImageProcessor . Web . Caching ;
25
26
using ImageProcessor . Web . Configuration ;
26
27
using ImageProcessor . Web . Extensions ;
@@ -556,8 +557,16 @@ private async Task ProcessImageAsync(HttpContext context)
556
557
// Process the Image
557
558
MemoryStream outStream = new MemoryStream ( ) ;
558
559
559
- imageFactory . Load ( inStream ) . AutoProcess ( queryString ) . Save ( outStream ) ;
560
- mimeType = imageFactory . CurrentImageFormat . MimeType ;
560
+ if ( ! string . IsNullOrWhiteSpace ( queryString ) )
561
+ {
562
+ imageFactory . Load ( inStream ) . AutoProcess ( queryString ) . Save ( outStream ) ;
563
+ mimeType = imageFactory . CurrentImageFormat . MimeType ;
564
+ }
565
+ else
566
+ {
567
+ await inStream . CopyToAsync ( outStream ) ;
568
+ mimeType = FormatUtilities . GetFormat ( outStream ) . MimeType ;
569
+ }
561
570
562
571
// Fire the post processing event.
563
572
EventHandler < PostProcessingEventArgs > handler = OnPostProcessing ;
You can’t perform that action at this time.
0 commit comments