diff options
Diffstat (limited to 'Emby.Drawing')
| -rw-r--r-- | Emby.Drawing/ImageMagick/StripCollageBuilder.cs | 4 | ||||
| -rw-r--r-- | Emby.Drawing/ImageProcessor.cs | 20 |
2 files changed, 15 insertions, 9 deletions
diff --git a/Emby.Drawing/ImageMagick/StripCollageBuilder.cs b/Emby.Drawing/ImageMagick/StripCollageBuilder.cs index a50a75ccd..7ed0f36e2 100644 --- a/Emby.Drawing/ImageMagick/StripCollageBuilder.cs +++ b/Emby.Drawing/ImageMagick/StripCollageBuilder.cs @@ -285,14 +285,14 @@ namespace Emby.Drawing.ImageMagick private MagickWand BuildThumbCollageWand(List<string> paths, int width, int height) { - var inputPaths = ImageHelpers.ProjectPaths(paths, 8); + var inputPaths = ImageHelpers.ProjectPaths(paths, 4); using (var wandImages = new MagickWand(inputPaths.ToArray())) { var wand = new MagickWand(width, height); wand.OpenImage("gradient:#111111-#111111"); using (var draw = new DrawingWand()) { - var iSlice = Convert.ToInt32(width * .1166666667); + var iSlice = Convert.ToInt32(width * .1166666667 * 2); int iTrans = Convert.ToInt32(height * .25); int iHeight = Convert.ToInt32(height * .62); var horizontalImagePadding = Convert.ToInt32(width * 0.0125); diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 2ba4f5aab..970b463cd 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -189,7 +189,7 @@ namespace Emby.Drawing dateModified = tuple.Item2; } - var originalImageSize = GetImageSize(originalImagePath, dateModified); + var originalImageSize = GetImageSize(originalImagePath, dateModified, true); // Determine the output size based on incoming parameters var newSize = DrawingUtils.Resize(originalImageSize, options.Width, options.Height, options.MaxWidth, options.MaxHeight); @@ -363,12 +363,12 @@ namespace Emby.Drawing /// <returns>ImageSize.</returns> public ImageSize GetImageSize(string path) { - return GetImageSize(path, File.GetLastWriteTimeUtc(path)); + return GetImageSize(path, File.GetLastWriteTimeUtc(path), false); } public ImageSize GetImageSize(ItemImageInfo info) { - return GetImageSize(info.Path, info.DateModified); + return GetImageSize(info.Path, info.DateModified, false); } /// <summary> @@ -376,9 +376,10 @@ namespace Emby.Drawing /// </summary> /// <param name="path">The path.</param> /// <param name="imageDateModified">The image date modified.</param> + /// <param name="allowSlowMethod">if set to <c>true</c> [allow slow method].</param> /// <returns>ImageSize.</returns> /// <exception cref="System.ArgumentNullException">path</exception> - private ImageSize GetImageSize(string path, DateTime imageDateModified) + private ImageSize GetImageSize(string path, DateTime imageDateModified, bool allowSlowMethod) { if (string.IsNullOrEmpty(path)) { @@ -393,7 +394,7 @@ namespace Emby.Drawing if (!_cachedImagedSizes.TryGetValue(cacheHash, out size)) { - size = GetImageSizeInternal(path); + size = GetImageSizeInternal(path, allowSlowMethod); _cachedImagedSizes.AddOrUpdate(cacheHash, size, (keyName, oldValue) => size); } @@ -405,8 +406,9 @@ namespace Emby.Drawing /// Gets the image size internal. /// </summary> /// <param name="path">The path.</param> + /// <param name="allowSlowMethod">if set to <c>true</c> [allow slow method].</param> /// <returns>ImageSize.</returns> - private ImageSize GetImageSizeInternal(string path) + private ImageSize GetImageSizeInternal(string path, bool allowSlowMethod) { ImageSize size; @@ -416,7 +418,11 @@ namespace Emby.Drawing } catch { - _logger.Info("Failed to read image header for {0}. Doing it the slow way.", path); + if (!allowSlowMethod) + { + throw; + } + //_logger.Info("Failed to read image header for {0}. Doing it the slow way.", path); CheckDisposed(); |
