Fix for single source multi position images
This commit is contained in:
@@ -35,7 +35,7 @@ public static partial class ImageManager
|
||||
}
|
||||
|
||||
string variant = null;
|
||||
if (endpoint.Variants.Any() && TrueRandom.Next(0, 50) > 25)
|
||||
if (endpoint.Variants != null && endpoint.Variants.Any() && TrueRandom.Next(0, 50) > 25)
|
||||
{
|
||||
variant = endpoint.Variants.Random().Name;
|
||||
}
|
||||
@@ -145,9 +145,11 @@ public static partial class ImageManager
|
||||
}
|
||||
|
||||
int img = 0;
|
||||
foreach (var src in sources)
|
||||
for(int x = 0; x < template.Positions.Count; x++)
|
||||
{
|
||||
var position = template.Positions.ElementAtOrDefault(img);
|
||||
var position = template.Positions.ElementAtOrDefault(x);
|
||||
|
||||
var src = sources.ElementAtOrDefault(img);
|
||||
|
||||
Stream imageData = null;
|
||||
if (File.Exists(src))
|
||||
@@ -176,7 +178,10 @@ public static partial class ImageManager
|
||||
|
||||
image.Composite(tmp, Gravity.Northwest, position.X, position.Y, CompositeOperator.Over);
|
||||
|
||||
img++;
|
||||
if (img + 1 < sources.Count())
|
||||
{
|
||||
img++;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user