aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing.Net/DynamicImageHelpers.cs
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2019-01-05 03:07:00 +0300
committerGitHub <noreply@github.com>2019-01-05 03:07:00 +0300
commit80c3832610fa327beb86c8a34cab092025a46291 (patch)
treeffbd66938814d7da0bb18fc9e0463a0a0452e8aa /Emby.Drawing.Net/DynamicImageHelpers.cs
parentf93cd97f9b66939908f95b601e2cbffa2e9eb63c (diff)
parent22adb838e6364839647a60731c17b464e494538a (diff)
Merge pull request #391 from EraYaN/remove-old-imageencoders
Remove old ImageEncoders (ImageMagick & Drawing.Net). Skia should be enough.
Diffstat (limited to 'Emby.Drawing.Net/DynamicImageHelpers.cs')
-rw-r--r--Emby.Drawing.Net/DynamicImageHelpers.cs110
1 files changed, 0 insertions, 110 deletions
diff --git a/Emby.Drawing.Net/DynamicImageHelpers.cs b/Emby.Drawing.Net/DynamicImageHelpers.cs
deleted file mode 100644
index 1910f7840..000000000
--- a/Emby.Drawing.Net/DynamicImageHelpers.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-using System.Collections.Generic;
-using System.Drawing;
-using System.Drawing.Drawing2D;
-using System.Drawing.Imaging;
-using System.IO;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.IO;
-using MediaBrowser.Model.IO;
-
-namespace Emby.Drawing.Net
-{
- public static class DynamicImageHelpers
- {
- public static void CreateThumbCollage(List<string> files,
- IFileSystem fileSystem,
- string file,
- int width,
- int height)
- {
- const int numStrips = 4;
- files = ImageHelpers.ProjectPaths(files, numStrips);
-
- const int rows = 1;
- int cols = numStrips;
-
- int cellWidth = 2 * (width / 3);
- int cellHeight = height;
- var index = 0;
-
- using (var img = new Bitmap(width, height, PixelFormat.Format32bppPArgb))
- {
- using (var graphics = Graphics.FromImage(img))
- {
- graphics.CompositingQuality = CompositingQuality.HighQuality;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
- graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
-
- // SourceCopy causes the image to be blank in OSX
- //graphics.CompositingMode = CompositingMode.SourceCopy;
-
- for (var row = 0; row < rows; row++)
- {
- for (var col = 0; col < cols; col++)
- {
- var x = col * (cellWidth / 2);
- var y = row * cellHeight;
-
- if (files.Count > index)
- {
- using (var imgtemp = Image.FromFile(files[index]))
- {
- graphics.DrawImage(imgtemp, x, y, cellWidth, cellHeight);
- }
- }
-
- index++;
- }
- }
- img.Save(file);
- }
- }
- }
-
- public static void CreateSquareCollage(List<string> files,
- IFileSystem fileSystem,
- string file,
- int width,
- int height)
- {
- files = ImageHelpers.ProjectPaths(files, 4);
-
- const int rows = 2;
- const int cols = 2;
-
- int singleSize = width / 2;
- var index = 0;
-
- using (var img = new Bitmap(width, height, PixelFormat.Format32bppPArgb))
- {
- using (var graphics = Graphics.FromImage(img))
- {
- graphics.CompositingQuality = CompositingQuality.HighQuality;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
- graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
-
- // SourceCopy causes the image to be blank in OSX
- //graphics.CompositingMode = CompositingMode.SourceCopy;
-
- for (var row = 0; row < rows; row++)
- {
- for (var col = 0; col < cols; col++)
- {
- var x = col * singleSize;
- var y = row * singleSize;
-
- using (var imgtemp = Image.FromFile(files[index]))
- {
- graphics.DrawImage(imgtemp, x, y, singleSize, singleSize);
- }
- index++;
- }
- }
- img.Save(file);
- }
- }
- }
- }
-}