added more metadata control

This commit is contained in:
Luke Pulverenti
2013-12-26 01:17:19 -05:00
parent 7c8424bf61
commit 25db52003c
13 changed files with 58 additions and 56 deletions

View File

@@ -228,17 +228,12 @@ 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)
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))
{