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