aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2013-12-25 20:07:29 -0800
committerLuke <luke.pulverenti@gmail.com>2013-12-25 20:07:29 -0800
commit7c8424bf611b90cf27ce8d8d94b26f0da612d114 (patch)
treea5ae5be0c1de2572698d02683bfe7968ed6c4b15 /MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
parentcf094f9a6d19e484006781ac21262eb3fafdcbf2 (diff)
parent320495a5653ba931f5f1545954364e0e06d35b00 (diff)
Merge pull request #652 from abeloin/master
Linux fixes
Diffstat (limited to 'MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
index fbe78e938..7ce0cad73 100644
--- a/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
+++ b/MediaBrowser.Server.Implementations/Drawing/ImageProcessor.cs
@@ -228,8 +228,17 @@ namespace MediaBrowser.Server.Implementations.Drawing
// Graphics.FromImage will throw an exception if the PixelFormat is Indexed, so we need to handle that here
using (var thumbnail = new Bitmap(newWidth, newHeight, PixelFormat.Format32bppPArgb))
{
+ #if __MonoCS__
+ // Mono throw an exeception if assign 0 to SetResolution
+ if (originalImage.HorizontalResolution != 0 && originalImage.VerticalResolution != 0)
+ {
+ // Preserve the original resolution
+ thumbnail.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
+ }
+ #else
// Preserve the original resolution
thumbnail.SetResolution(originalImage.HorizontalResolution, originalImage.VerticalResolution);
+ #endif
using (var thumbnailGraph = Graphics.FromImage(thumbnail))
{