merge marcio

This commit is contained in:
Maddo Scientisto 2021-02-25 11:52:23 +01:00
commit ee5b29ae0b
24 changed files with 1869 additions and 628 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "MaddoLibrary"]
path = MaddoLibrary
url = git@gitlab.com:MaddoTools/MaddoLibrary.git

View file

@ -17,6 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaddoShared", "MaddoShared\MaddoShared.csproj", "{AEBFE9E3-277C-4A7B-8448-145D1B11998B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaddoLibrary.Base.NET46", "MaddoLibrary\MaddoLibrary.Base.NET46\MaddoLibrary.Base.NET46.csproj", "{E93DAAE6-4AA9-4A45-AFB6-58209B3AD3C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaddoLibrary.WPF.NET46", "MaddoLibrary\MaddoLibrary.WPF.NET46\MaddoLibrary.WPF.NET46.csproj", "{73DA19D7-196D-4B16-B610-93250978A607}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View file

@ -60,28 +60,33 @@
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SixLabors.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Core.0.1.0-alpha0002\lib\netstandard1.1\SixLabors.Core.dll</HintPath>
<Reference Include="SixLabors.Core, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Core.1.0.0-beta0002\lib\netstandard1.1\SixLabors.Core.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Fonts.0.1.0-alpha0014\lib\netstandard1.3\SixLabors.Fonts.dll</HintPath>
<HintPath>..\packages\SixLabors.Fonts.1.0.0-beta0001\lib\netstandard1.3\SixLabors.Fonts.dll</HintPath>
</Reference>
<Reference Include="SixLabors.ImageSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.ImageSharp.1.0.0-beta0001\lib\netstandard1.3\SixLabors.ImageSharp.dll</HintPath>
</Reference>
<Reference Include="SixLabors.ImageSharp.Drawing, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.ImageSharp.Drawing.1.0.0-beta0001\lib\netstandard1.1\SixLabors.ImageSharp.Drawing.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Shapes, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Shapes.0.1.0-alpha0018\lib\netstandard1.1\SixLabors.Shapes.dll</HintPath>
<HintPath>..\packages\SixLabors.Shapes.1.0.0-beta0001\lib\netstandard1.1\SixLabors.Shapes.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Shapes.Text, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Shapes.Text.0.1.0-alpha0018\lib\netstandard1.1\SixLabors.Shapes.Text.dll</HintPath>
<HintPath>..\packages\SixLabors.Shapes.Text.1.0.0-beta0001\lib\netstandard1.1\SixLabors.Shapes.Text.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.AppContext, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll</HintPath>
</Reference>
<Reference Include="System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.3.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard1.1\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Console, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@ -109,7 +114,7 @@
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.4.0-preview1-25305-02\lib\netstandard1.0\System.Memory.dll</HintPath>
<HintPath>..\packages\System.Memory.4.4.0-preview2-25405-01\lib\netstandard1.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
@ -118,11 +123,11 @@
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.3.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0-preview1-25305-02\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.4.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
@ -140,7 +145,7 @@
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net46\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0-preview1-25305-02\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@ -153,11 +158,11 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Enums.cs" />
<Compile Include="IImageProcessor.cs" />
<Compile Include="ImageCreator.cs" />
<Compile Include="ImageCreator2.cs" />
<Compile Include="ImgSharpCreator.cs" />
<Compile Include="MaddoLogger.cs" />
<Compile Include="PicSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SinglePicData.cs" />
@ -167,10 +172,15 @@
<Project>{44465926-240d-473f-90b8-786ba4384406}</Project>
<Name>CatalogVbLib</Name>
</ProjectReference>
<ProjectReference Include="..\MaddoLibrary\MaddoLibrary.Base.NET46\MaddoLibrary.Base.NET46.csproj">
<Project>{e93daae6-4aa9-4a45-afb6-58209b3ad3c9}</Project>
<Name>MaddoLibrary.Base.NET46</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Settings\" />

41
CatalogLib/Enums.cs Normal file
View file

@ -0,0 +1,41 @@
namespace CatalogLib
{
public enum Positions
{
Alto,
Centro,
Basso
}
public enum Alignments
{
Sinistra,
Centro,
Destra
}
public enum ResizeModes
{
Bicubic,
Box,
CatmullRom,
Hermite,
Lanczos2,
Lanczos3,
Lanczos5,
Lanczos8,
MitchellNetravali,
NearestNeighbor,
Robidoux,
Spline,
Triangle,
Welch
}
public enum ResizeDimensions
{
LatoLungo,
LatoCorto
}
}

View file

@ -394,7 +394,7 @@ namespace CatalogLib
}
switch (_picSettings.Posizione.ToUpper())
switch (_picSettings.TextPosition.ToString().ToUpper())
{
case "ALTO":
yPosFromBottom1 = _picSettings.Margine;

View file

@ -1,41 +1,76 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using ImageSharp;
using ImageSharp.Drawing;
using ImageSharp.PixelFormats;
using ImageSharp.Processing;
using MaddoLibrary.Base.Log;
using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.MetaData.Profiles.Exif;
using SixLabors.ImageSharp.Processing;
using SixLabors.Primitives;
using Font = SixLabors.Fonts.Font;
using FontFamily = SixLabors.Fonts.FontFamily;
using FontStyle = SixLabors.Fonts.FontStyle;
using Image = ImageSharp.Image;
using Rgba32 = SixLabors.ImageSharp.Rgba32;
using Image = SixLabors.ImageSharp.Image;
namespace CatalogLib
{
public class ImgSharpCreator : IImageProcessor
{
private Image<Rgba32> _logo;
public ImgSharpCreator()
{
if (!PicSettings.Instance.EnableLogo) return;
if (string.IsNullOrWhiteSpace(PicSettings.Instance.LogoPath)) return;
if (!File.Exists(PicSettings.Instance.LogoPath)) return;
_logo = Image.Load(PicSettings.Instance.LogoPath);
}
private FileInfo _currentFile;
public void Start(FileInfo workFile)
{
Stopwatch s = new Stopwatch();
s.Start();
_currentFile = workFile;
using (Image<Rgba32> image = Image.Load(workFile.FullName)/* new Image(workFile.FullName)*/)
{
MaddoLogger.Log("Loaded Image: {0}", workFile.FullName);
//image.Rotate(-90);
bool isRotated;
var orientation = image.MetaData.ExifProfile.GetValue(ExifTag.Orientation);
if ((ushort)orientation.Value != 1)
{
isRotated = true;
}
else
{
isRotated = false;
}
if (PicSettings.Instance.FotoRidimensiona)
{
Resize(image);
}
if (PicSettings.Instance.GeneraleRotazioneAutomatica)
{
image.AutoOrient();
image.Mutate(img => img.AutoOrient());
MaddoLogger.Log("Rotated Image: {0}", workFile.FullName);
//image.AutoOrient();
//var exif = image.MetaData.ExifProfile;
//if (exif != null)
@ -98,25 +133,134 @@ namespace CatalogLib
if (PicSettings.Instance.EnableText)
{
SetExtraText(image);
//SetTextTest(image);
SetExtraText(image, isRotated);
MaddoLogger.Log("Drawn text on Image: {0}", workFile.FullName);
}
//JpegDecoder j = new JpegDecoder();
var va = Vector.IsHardwareAccelerated;
MaddoLogger.Log("Hardware Accelerated: {0}", va);
//image.Resize(PicSettings.Instance.FotoLarghezza, PicSettings.Instance.FotoAltezza);
//image.Resize(2240, 2240);
//var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont);
//var font = new Font(fff, (float)PicSettings.Instance.DimensioneFont, FontStyle.Regular);
//image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200));
image.Save(Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name));
image.Save(Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name), new JpegEncoder() { Quality = PicSettings.Instance.CompressioneJpeg });
//image.Resize(200, 200).Save("");
MaddoLogger.Log("Saved Image: {0} to: {1}", workFile.FullName, Path.Combine(PicSettings.Instance.DirectoryDestinazione, workFile.Name));
}
s.Stop();
MaddoLogger.Log("Time Taken for {0}: {1}", workFile.FullName, s.Elapsed);
}
private void Resize(Image<Rgba32> image)
{
IResampler resampler;
switch (PicSettings.Instance.ResizeMode)
{
case ResizeModes.Bicubic:
resampler = new BicubicResampler();
break;
case ResizeModes.Box:
resampler = new BoxResampler();
break;
case ResizeModes.CatmullRom:
resampler = new CatmullRomResampler();
break;
case ResizeModes.Hermite:
resampler = new HermiteResampler();
break;
case ResizeModes.Lanczos2:
resampler = new Lanczos2Resampler();
break;
case ResizeModes.Lanczos3:
resampler = new Lanczos3Resampler();
break;
case ResizeModes.Lanczos5:
resampler = new Lanczos5Resampler();
break;
case ResizeModes.Lanczos8:
resampler = new Lanczos8Resampler();
break;
case ResizeModes.MitchellNetravali:
resampler = new MitchellNetravaliResampler();
break;
case ResizeModes.NearestNeighbor:
resampler = new NearestNeighborResampler();
break;
case ResizeModes.Robidoux:
resampler = new RobidouxResampler();
break;
case ResizeModes.Spline:
resampler = new SplineResampler();
break;
case ResizeModes.Triangle:
resampler = new TriangleResampler();
break;
case ResizeModes.Welch:
resampler = new WelchResampler();
break;
default:
throw new ArgumentOutOfRangeException();
}
// todo calcolare ridimensionamento
var size = new Size(PicSettings.Instance.FotoLarghezza, PicSettings.Instance.FotoAltezza);
if (PicSettings.Instance.FotoMantieniDimensioni)
{
size = ResizeImage(image, size, PicSettings.Instance.ResizeDimension);
image.Mutate(x => x.Resize((size.Width), (size.Height), resampler));
//Width Formula:
//original height / original width * new width = new height
//Height Formula:
//orignal width / orignal height * new height = new width
}
else
{
image.Mutate(x => x.Resize(PicSettings.Instance.FotoAltezza, PicSettings.Instance.FotoLarghezza, resampler));
}
}
private void SetExtraText(Image<Rgba32> image)
private Size ResizeImage(Image<Rgba32> image, Size size, ResizeDimensions side)
{
switch (side)
{
case ResizeDimensions.LatoLungo:
size = GetResizeDimensions(new Size(image.Width, image.Height), size, image.Width > image.Height);
break;
case ResizeDimensions.LatoCorto:
size = GetResizeDimensions(new Size(image.Width, image.Height), size, image.Width <= image.Height);
break;
default:
throw new ArgumentOutOfRangeException();
}
return size;
}
private Size GetResizeDimensions(Size originalSize, Size newSize, bool adjustHeight)
{
return adjustHeight ? new Size(newSize.Width, originalSize.Height / originalSize.Width * newSize.Height) : new Size(originalSize.Width / originalSize.Height * newSize.Height, newSize.Height);
}
private void SetTextTest(Image<Rgba32> image)
{
string text = "test test test test test testtest test test test test test test";
Font font = new Font(SystemFonts.Find("verdana"), 300, FontStyle.Regular);
image.Mutate(x => x.DrawText(text, font, Rgba32.Yellow, new PointF(2760, 3295.54932f), new TextGraphicsOptions()
{
HorizontalAlignment = HorizontalAlignment.Center
}));
}
private void SetExtraText(Image<Rgba32> image, bool isRotated)
{
if (string.IsNullOrWhiteSpace(PicSettings.Instance.TestoApplicareOrizzontale))
{
@ -124,6 +268,24 @@ namespace CatalogLib
return;
}
string text;
if (isRotated)
{
if (PicSettings.Instance.TestoApplicareOrizzontale.Contains("$_"))
{
text = PicSettings.Instance.TestoApplicareOrizzontale.Replace("$_", "\r\n");
}
else
{
text = PicSettings.Instance.TestoApplicareOrizzontale.Replace("$_", "");
}
}
else
{
text = PicSettings.Instance.TestoApplicareOrizzontale.Replace("$_", "");
}
var fo = SixLabors.Fonts.SystemFonts.Find(PicSettings.Instance.NomeFont);
@ -131,12 +293,27 @@ namespace CatalogLib
//var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont);
//var fff = FontCollection.SystemFonts.Find("Segoe Print");
var font = new Font(fo, (float)PicSettings.Instance.DimensioneFont, FontStyle.Regular);
Font font;
if (!PicSettings.Instance.Grassetto)
{
font = new Font(fo, (float)PicSettings.Instance.DimensioneFont, FontStyle.Regular);
}
else
{
font = new Font(fo, (float)PicSettings.Instance.DimensioneFont, FontStyle.Bold);
}
// todo corsivo
//var font = new Font(fff, 8f, FontStyle.Regular);
//Color c = Color.FromHex(FlipRgbString(PicSettings.Instance.ColoreTestoRGB));
Rgba32 g = Rgba32.FromHex(FlipRgbString(PicSettings.Instance.ColoreTestoRGB));
Rgba32 gBack = Rgba32.Black; // todo alpha
//TextMeasurer measurer = new TextMeasurer();
//var size = measurer.MeasureText(PicSettings.Instance.TestoApplicareOrizzontale, font, 72);
@ -147,13 +324,197 @@ namespace CatalogLib
Vector2 center = new Vector2(image.Width / 2, image.Height / 2); //center horizontally, 10px down
var size = TextMeasurer.Measure(PicSettings.Instance.TestoApplicareOrizzontale, new RendererOptions(font));
var size = TextMeasurer.Measure(text, new RendererOptions(font));
var larghezzaStandard = size.Width;
var dimensioneStandard = (int)Math.Round(PicSettings.Instance.DimensioneFont);
if (size.Width > image.Width)
{
var c = dimensioneStandard;
do
{
if (c > 20)
{
c -= 5;
}
else
{
c -= 1;
}
if (PicSettings.Instance.Grassetto)
{
font = new Font(fo, c, FontStyle.Bold);
}
else
{
font = new Font(fo, c, FontStyle.Regular);
}
size = TextMeasurer.Measure(text,
new RendererOptions(font));
if (size.Width < image.Width)
{
larghezzaStandard = (int)Math.Round(size.Width);
break;
}
if (c <= 5)
{
break;
}
} while (dimensioneStandard == c);
}
float yPosFromBottom = 0;
switch (PicSettings.Instance.TextPosition)
{
case Positions.Alto:
yPosFromBottom = PicSettings.Instance.Margine;
break;
case Positions.Basso:
yPosFromBottom = image.Height - size.Height - (image.Height * PicSettings.Instance.Margine / 100);
break;
}
float xCenterofImg = 0;
// stringformat
switch (PicSettings.Instance.TextAlignment)
{
case Alignments.Sinistra:
xCenterofImg = PicSettings.Instance.Margine + (larghezzaStandard / 2);
if ((larghezzaStandard / 2) > (image.Width / 2) - PicSettings.Instance.Margine)
{
xCenterofImg = image.Width / 2;
}
break;
case Alignments.Centro:
xCenterofImg = image.Width / 2;
break;
case Alignments.Destra:
xCenterofImg = image.Width - PicSettings.Instance.Margine - larghezzaStandard / 2;
if (larghezzaStandard / 2 > image.Width / 2 - PicSettings.Instance.Margine)
{
xCenterofImg = image.Width / 2;
}
break;
}
// stringformat alignment center
if (PicSettings.Instance.Grassetto)
{
font = new Font(fo, dimensioneStandard, FontStyle.Bold);
}
else
{
font = new Font(fo, dimensioneStandard, FontStyle.Regular);
}
image.Mutate(x => x.DrawText(text, font, gBack, new PointF((float)Math.Round(xCenterofImg + 1), (float)Math.Round(yPosFromBottom + 1)), new TextGraphicsOptions()
{
HorizontalAlignment = HorizontalAlignment.Center
}));
image.Mutate(x => x.DrawText(text, font, g, new PointF((float)Math.Round(xCenterofImg), (float)Math.Round(yPosFromBottom)), new TextGraphicsOptions()
{
HorizontalAlignment = HorizontalAlignment.Center
}));
return;
float scalingFactor = Math.Min(image.Width / size.Width, image.Height / size.Height);
Font scaledFont = new Font(font, scalingFactor * font.Size);
image.Mutate(x =>
x.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center,
new TextGraphicsOptions(true)
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom
}));
//image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
}
private void AddLogo(Image<Rgba32> image)
{
//if (string.IsNullOrWhiteSpace(PicSettings.Instance.LogoPath)) return;
//if (!File.Exists(PicSettings.Instance.LogoPath)) return;
//using (Image<Rgba32> logo = Image.Load(PicSettings.Instance.LogoPath))
//{
// Size size = new Size();
// Point location = new Point();
// image.Mutate(x => x.DrawImage(logo, size, location, new GraphicsOptions()
// {
// }));
//}
Size size = new Size();
Point location = new Point();
if (_logo != null)
{
var width = PicSettings.Instance.LogoWidth;
var height = PicSettings.Instance.LogoHeight;
var heightFactor = _logo.Height / height;
var widthFactor = _logo.Width / width;
var newLogoSize = new Size();
newLogoSize = GetResizeDimensions(new Size(_logo.Width, _logo.Height), new Size(width, height), PicSettings.Instance.LogoResizeSide.Equals(ResizeDimensions.LatoCorto));
//todo riguardare perché non torna cosa ho fatto
int margineUsato = 0;
int margineL;
bool inPercentualeL;
inPercentualeL = PicSettings.Instance.LogoMargin.EndsWith("%");
if (inPercentualeL)
{
margineL = int.Parse(PicSettings.Instance.LogoMargin.Replace("%", ""));
}
else
{
margineL = int.Parse(PicSettings.Instance.LogoMargin);
}
switch (PicSettings.Instance.LogoPosition)
{
case Positions.Alto:
break;
case Positions.Centro:
break;
case Positions.Basso:
break;
default:
throw new ArgumentOutOfRangeException();
}
switch (PicSettings.Instance.LogoAlignment)
{
case Alignments.Sinistra:
location.X = margineUsato;
break;
case Alignments.Centro:
//location.X = image.Width -
break;
case Alignments.Destra:
break;
default:
throw new ArgumentOutOfRangeException();
}
image.Mutate(x => x.DrawImage(_logo, size, location, new GraphicsOptions()));
}
}
@ -166,7 +527,7 @@ namespace CatalogLib
var size = TextMeasurer.Measure("Test test test test test", new RendererOptions(font));
float scalingFactor = Math.Min(image.Width / size.Width, image.Height / size.Height);
Font scaledFont = new Font(font, scalingFactor * font.Size);
image.DrawText("Test test test test test", scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom });
image.Mutate(x => x.DrawText("Test test test test test", scaledFont, g, center, new TextGraphicsOptions(true) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom }));
}
private string FlipRgbString(string originalString)

View file

@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CatalogLib
{
public class MaddoLogger
{
public void AddToLog(string data)
{
string dest = Path.Combine(PicSettings.Instance.DirectoryDestinazione, "log.txt");
}
}
}

View file

@ -6,7 +6,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MaddoLibrary.Base.Log;
using Newtonsoft.Json;
namespace CatalogLib
@ -71,6 +71,11 @@ namespace CatalogLib
SetBase(key, value);
}
public void SetFloat(string key, float value)
{
SetBase(key, value);
}
public void Set<T>(string key, T value)
{
SetBase(key, value);
@ -134,6 +139,23 @@ namespace CatalogLib
return (double)_settingsDict[key];
}
public float GetFloat(string key, float defaultValue = 0)
{
if (!_settingsDict.ContainsKey(key))
{
SetFloat(key, defaultValue);
}
if (_settingsDict[key] is float f) return f;
MaddoLogger.LogError("Error while parsing {0}", key);
float fl = 0;
SetFloat(key, float.TryParse(_settingsDict[key].ToString(), out f) ? fl : defaultValue);
return (float)_settingsDict[key];
}
public T Get<T>(string key, T defaultValue)
{
if (!_settingsDict.ContainsKey(key))
@ -146,6 +168,8 @@ namespace CatalogLib
}
public string GetString(string key, string defaultValue = "")
{
if (!_settingsDict.ContainsKey(key))
@ -184,7 +208,10 @@ namespace CatalogLib
//return _settingsDict.ContainsKey(key) ? _settingsDict[key] : defaultValue;
}
public T GetEnum<T>(string name, T defaultValue)
{
return (T)Enum.Parse(typeof(T), GetString(name, defaultValue.ToString()));
}
public void SetDefaults()
{
@ -193,8 +220,8 @@ namespace CatalogLib
public bool DirAggiornaSottoDirectory
{
get { return this.GetBool("DirAggiornaSottoDirectory", true); }
set { this.SetBool("DirAggiornaSottoDirectory", value); }
get => this.GetBool("DirAggiornaSottoDirectory", true);
set => this.SetBool("DirAggiornaSottoDirectory", value);
}
public bool Grassetto
@ -262,12 +289,8 @@ namespace CatalogLib
get { return 0; }
}
public string Posizione
{
get { return string.Empty; }
}
public DateTime DataPartenza { get; set; }
public string TestoOrario { get; internal set; }
public int DimStandard { get; internal set; }
@ -290,7 +313,11 @@ namespace CatalogLib
set { SetString("DirDestinazione", value); }
}
public float Margine { get; set; }
public int Margine
{
get => GetInt("Margin", 1);
set => SetInt("Margin", value);
}
public float MargVert { get; set; }
public string Allineamento { get; set; }
@ -432,8 +459,90 @@ namespace CatalogLib
}
}
public bool FotoRidimensiona
{
get => GetBool("FotoRidimensiona", false);
set => Set("FotoRidimensiona", value);
}
public Positions TextPosition
{
get => GetEnum("TextPosition", Positions.Alto); //(Positions)Enum.Parse(typeof(Positions), GetString("TextPosition", Positions.Alto.ToString()));
set => SetString("TextPosition", value.ToString());
}
public Alignments TextAlignment
{
get => GetEnum("TextAlignment", Alignments.Centro);
set => SetString("TextAlignment", value.ToString());
}
public bool Threading
{
get => GetBool("Threading", true);
set => SetBool("Threading", value);
}
public ResizeModes ResizeMode
{
get => GetEnum("ResizeMode", ResizeModes.Bicubic);
set => SetString("ResizeMode", value.ToString());
}
public ResizeDimensions ResizeDimension
{
get => GetEnum("ResizeDimension", CatalogLib.ResizeDimensions.LatoCorto);
set => SetString("ResizeDimension", value.ToString());
}
public string LogoPath
{
get => GetString("LogoPath");
set => SetString("LogoPath", value);
}
public int LogoWidth
{
get => GetInt("LogoWidth");
set => SetInt("LogoWidth", value);
}
public int LogoHeight
{
get => GetInt("LogoHeight");
set => SetInt("LogoHeight", value);
}
public string LogoMargin
{
get => GetString("LogoMargin");
set => SetString("LogoMargin", value);
}
public Positions LogoPosition
{
get => GetEnum("LogoPositions", Positions.Alto);
set => SetString("LogoPositions", value.ToString());
}
public Alignments LogoAlignment
{
get => GetEnum("LogoAlignments", Alignments.Centro);
set => SetString("LogoAlignments", value.ToString());
}
public ResizeDimensions LogoResizeSide
{
get => GetEnum("LogoResizeMode", ResizeDimensions.LatoCorto);
set => SetString("LogoResizeMode", value.ToString());
}
#endregion
#region Enums
#endregion
}
}

View file

@ -16,11 +16,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />

View file

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ImageSharp" version="1.0.0-alpha9-00169" targetFramework="net46" />
<package id="ImageSharp.Drawing" version="1.0.0-alpha9-00164" targetFramework="net46" />
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net46" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net46" />
<package id="NETStandard.Library" version="1.6.1" targetFramework="net46" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
<package id="SixLabors.Core" version="0.1.0-alpha0002" targetFramework="net46" />
<package id="SixLabors.Fonts" version="0.1.0-alpha0014" targetFramework="net46" />
<package id="SixLabors.Shapes" version="0.1.0-alpha0018" targetFramework="net46" />
<package id="SixLabors.Shapes.Text" version="0.1.0-alpha0018" targetFramework="net46" />
<package id="SixLabors.Core" version="1.0.0-beta0002" targetFramework="net46" />
<package id="SixLabors.Fonts" version="1.0.0-beta0001" targetFramework="net46" />
<package id="SixLabors.ImageSharp" version="1.0.0-beta0001" targetFramework="net46" />
<package id="SixLabors.ImageSharp.Drawing" version="1.0.0-beta0001" targetFramework="net46" />
<package id="SixLabors.Shapes" version="1.0.0-beta0001" targetFramework="net46" />
<package id="SixLabors.Shapes.Text" version="1.0.0-beta0001" targetFramework="net46" />
<package id="System.AppContext" version="4.3.0" targetFramework="net46" />
<package id="System.Buffers" version="4.3.0" targetFramework="net46" />
<package id="System.Buffers" version="4.4.0" targetFramework="net46" />
<package id="System.Collections" version="4.3.0" targetFramework="net46" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net46" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net46" />
<package id="System.Collections.Immutable" version="1.4.0" targetFramework="net46" />
<package id="System.Console" version="4.3.0" targetFramework="net46" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net46" />
<package id="System.Diagnostics.DiagnosticSource" version="4.3.0" targetFramework="net46" />
@ -29,18 +29,18 @@
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net46" />
<package id="System.Linq" version="4.3.0" targetFramework="net46" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net46" />
<package id="System.Memory" version="4.4.0-preview1-25305-02" targetFramework="net46" />
<package id="System.Memory" version="4.4.0-preview2-25405-01" targetFramework="net46" />
<package id="System.Net.Http" version="4.3.0" targetFramework="net46" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="net46" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="net46" />
<package id="System.Numerics.Vectors" version="4.3.0" targetFramework="net46" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net46" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="net46" />
<package id="System.Reflection" version="4.3.0" targetFramework="net46" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="net46" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net46" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.4.0-preview1-25305-02" targetFramework="net46" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.4.0" targetFramework="net46" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net46" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net46" />
@ -57,7 +57,7 @@
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net46" />
<package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net46" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="net46" />
<package id="System.ValueTuple" version="4.4.0-preview1-25305-02" targetFramework="net46" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net46" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="net46" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="net46" />
</packages>

15
CatalogLib/stylecop.json Normal file
View file

@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings":
{
"orderingRules":
{
"usingDirectivesPlacement": "outsideNamespace"
},
"documentationRules":
{
"xmlHeader": false,
"copyrightText": "Copyright (c) Six Labors and contributors.\nLicensed under the Apache License, Version 2.0."
}
}
}

1
MaddoLibrary Submodule

@ -0,0 +1 @@
Subproject commit 5987cc26521d839bf81bdaab19d101488294da19

View file

@ -20,11 +20,11 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
@ -38,6 +38,14 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -7,10 +7,24 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:catalogLib="clr-namespace:CatalogLib;assembly=CatalogLib"
mc:Ignorable="d"
d:DesignHeight="900" d:DesignWidth="500"
d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}"
>
<UserControl.Resources>
<ObjectDataProvider x:Key="ResizeEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="catalogLib:ResizeModes" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="ResizeDimensionsEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="catalogLib:ResizeDimensions" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</UserControl.Resources>
<Grid>
<ScrollViewer>
<StackPanel Orientation="Vertical">
@ -65,6 +79,7 @@
<CheckBox Content="Forza JPG" x:Name="chkForzaJPG" IsChecked="{Binding GeneraleForzaJPG}" Margin="2"/>
<CheckBox Content="Rotazione Automatica" x:Name="chkRotazioneAutomatica" IsChecked="{Binding GeneraleRotazioneAutomatica}" Margin="2"/>
<CheckBox Content="Sovrascrivi File" x:Name="chkSovrascriviFile" IsChecked="{Binding GeneraleSovrascriviFile}" Margin="2"/>
<CheckBox Content="MultiThreading" IsChecked="{Binding Threading}" Margin="2"></CheckBox>
</StackPanel>
</GroupBox>
<GroupBox Header="Sottocartelle" Margin="2">
@ -80,6 +95,7 @@
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Grid.Column="1" Content="Crea Sottocartelle" x:Name="chkCreaSottocartelle" Margin="4,0,0,0" IsChecked="{Binding SubdirCreaSottoCartelle}"/>
@ -112,6 +128,8 @@
</GroupBox.Header>
<Grid >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
@ -125,16 +143,19 @@
<ColumnDefinition Width="88*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Altezza" Grid.ColumnSpan="2" Margin="0,0,0,2" />
<TextBox Grid.Row="0" Grid.Column="2" Margin="4,4,4,6" Text="{Binding FotoAltezza}"/>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Ridimensiona"></Label>
<CheckBox Grid.Row="0" Grid.Column="2" IsChecked="{Binding FotoRidimensiona}"></CheckBox>
<Label Grid.Row="1" Grid.Column="0" Content="Altezza" Grid.ColumnSpan="2" Margin="0,0,0,2" />
<TextBox Grid.Row="1" Grid.Column="2" Margin="4,4,4,6" Text="{Binding FotoAltezza}"/>
<Label Grid.Column="0" Content="Larghezza" Grid.ColumnSpan="2" Margin="0,26,0,2" Grid.RowSpan="2" />
<TextBox Grid.Row="1" Grid.Column="2" Margin="4,2,4,6" Text="{Binding FotoLarghezza}"></TextBox>
<Label Grid.Row="1" Grid.Column="0" Content="Larghezza" Grid.ColumnSpan="2" Margin="0,26,0,2" Grid.RowSpan="2" />
<TextBox Grid.Row="2" Grid.Column="2" Margin="4,2,4,6" Text="{Binding FotoLarghezza}"></TextBox>
<Label Grid.Row="1" Grid.Column="0" Content="Qualità" Grid.ColumnSpan="2" Margin="0,24,0,1" Grid.RowSpan="2" />
<Label Grid.Row="2" Grid.Column="0" Content="Qualità" Grid.ColumnSpan="2" Margin="0,24,0,1" Grid.RowSpan="2" />
<!--<TextBox Grid.Row="2" Grid.Column="2" Width="80" Margin="4,2,4,5" />-->
<Grid Grid.Row="2" Grid.Column="2" >
<Grid Grid.Row="3" Grid.Column="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="20"/>
@ -144,13 +165,19 @@
</Grid>
<CheckBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,16,0,17.88" IsChecked="{Binding FotoMantieniDimensioni}"/>
<TextBlock Grid.Row="3" Grid.Column="2" Text="Mantieni Dimensioni Originali" TextWrapping="WrapWithOverflow" Width="80" Margin="4,0,4,25.88" Grid.RowSpan="2" />
<CheckBox Grid.Row="4" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,16,0,17.88" IsChecked="{Binding FotoMantieniDimensioni}"/>
<TextBlock Grid.Row="4" Grid.Column="0" VerticalAlignment="Center" Grid.ColumnSpan="2" HorizontalAlignment="Left" Text="Mantieni Rapporto di aspetto" TextWrapping="WrapWithOverflow" Margin="4,0,4,25.88" />
<Label Grid.Row="4" Grid.Column="0" Content="Suffisso" Grid.ColumnSpan="2" Margin="0,0.12,0,-0.12" />
<TextBox Grid.Row="4" Grid.Column="2" Width="80" Margin="4,4.12,4,3.88" Text="{Binding FotoSuffisso}" />
<Label Grid.Row="5" Grid.Column="0" Content="Suffisso" Grid.ColumnSpan="2" Margin="0,0.12,0,-0.12" />
<TextBox Grid.Row="5" Grid.Column="2" Margin="4,4.12,4,3.88" Text="{Binding FotoSuffisso}" />
<Label Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2">Algoritmo di ridimensionamento</Label>
<ComboBox Grid.Row="6" Grid.Column="2" ItemsSource="{Binding Source={StaticResource ResizeEnum}}" SelectedItem="{Binding ResizeMode}"></ComboBox>
<Label Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2">Lato ridimensionamento</Label>
<ComboBox Grid.Row="7" Grid.Column="2" ItemsSource="{Binding Source={StaticResource ResizeDimensionsEnum}}" SelectedItem="{Binding ResizeDimension}"></ComboBox>
</Grid>
</GroupBox>
</StackPanel>

View file

@ -6,12 +6,24 @@
xmlns:wpfCatalog="clr-namespace:WPFCatalog"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
mc:Ignorable="d"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:catalogLib="clr-namespace:CatalogLib;assembly=CatalogLib"
mc:Ignorable="d"
d:DesignHeight="900" d:DesignWidth="500"
d:DataContext="{d:DesignInstance wpfCatalog:MainWindowViewModel}" >
<UserControl.Resources>
<wpfCatalog:FontFamilyStringConverter x:Key="FontFamilyConverter" />
<wpfCatalog:MaddoColorConverter x:Key="ColorConverter" />
<ObjectDataProvider x:Key="PositionsEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="catalogLib:Positions" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
<ObjectDataProvider x:Key="AlignmentEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="catalogLib:Alignments" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</UserControl.Resources>
<ScrollViewer>
<StackPanel Orientation="Vertical">
@ -42,8 +54,8 @@
Text="{Binding FontName}"
></TextBox>
<Label Content="Grassetto" Grid.Row="2" Grid.Column="0"></Label>
<CheckBox Grid.Row="2" Grid.Column="1"></CheckBox>
<CheckBox Grid.Row="2" Grid.Column="1" IsChecked="{Binding Grassetto}"></CheckBox>
<Label Content="Corsivo" Grid.Row="3" Grid.Column="0"></Label>
<CheckBox Grid.Row="3" Grid.Column="1"></CheckBox>
@ -81,28 +93,8 @@
</GroupBox>
<StackPanel Orientation="Vertical" VerticalAlignment="Stretch">
<GroupBox Header="Slide Show" VerticalAlignment="Stretch">
<StackPanel Orientation="Horizontal" >
<CheckBox Content="Data" Margin="5,0" IsChecked="{Binding SlideshowData}"/>
<CheckBox Content="Numero Foto" Margin="5,0" IsChecked="{Binding SlideshowNumeroFoto}"/>
</StackPanel>
</GroupBox>
<GroupBox Header="Testo foto verticali" VerticalAlignment="Stretch">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Dimensione Carattere"/>
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TestoVertDimensioneCarattere}"/>
<Label Grid.Row="1" Grid.Column="0" Content="Margine"/>
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding TestoVertMargine}"/>
</Grid>
</GroupBox>
</StackPanel>
<GroupBox Header="Testo da applicare">
@ -117,9 +109,19 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Orizzontale" />
<Label Grid.Row="1" Grid.Column="0" Content="Verticale" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TestoApplicareOrizzontale}"/>
<TextBox Grid.Row="1" Grid.Column="1" Height="50" MaxLines="4" AcceptsReturn="True" Text="{Binding TestoApplicareVerticale}"/>
<Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" >
<TextBlock>
Legenda:<LineBreak/>
$_ A capo verticale<LineBreak/>
$o Orario<LineBreak/>
$t Tempo gara<LineBreak/>
$n Nome File
</TextBlock>
</Label>
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TestoApplicareOrizzontale}" AcceptsReturn="True"/>
</Grid>
<Grid>
<Grid.RowDefinitions>
@ -135,28 +137,28 @@
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Content="Trasparenza(0-100%)" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding TestoApplicareTrasparenza}" />
<Label Grid.Row="1" Grid.Column="0" Content="Posizione" />
<ComboBox Grid.Row="1" Grid.Column="1" />
<!--ToDo-->
<Label Grid.Row="1" Grid.Column="0" Content="Allineamento Verticale" />
<ComboBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource PositionsEnum}}" SelectedItem="{Binding TextPosition}">
<CheckBox Grid.Row="2" Grid.Column="1" Content="Orario" IsChecked="{Binding TestoApplicareOrario}"/>
<CheckBox Grid.Row="3" Grid.Column="1" Content="Tempo Gara" IsChecked="{Binding TestoApplicareTempoGaraCheck}"/>
</ComboBox>
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding TestoApplicareTempoGara}"/>
<ComboBox Grid.Row="2" Grid.Column="2" ItemsSource="{Binding Source={StaticResource AlignmentEnum}}" SelectedItem="{Binding TextAlignment}"></ComboBox>
<Label Grid.Row="6" Grid.Column="0" >Formato tempo gara</Label>
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding TestoApplicareTempoGara}"/>
<Label Grid.Row="5" Grid.Column="0" Content="Margine (pixel)" />
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding TestoApplicareMargine}"/>
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Margine}"/>
<Label Grid.Row="6" Grid.Column="0" Content="Allineamento" />
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding TestoApplicareAllineamento}"/>
<Label Grid.Row="7" Grid.Column="0" Content="Partenza" />
<ComboBox Grid.Row="7" Grid.Column="1" />
<xctk:DateTimePicker Grid.Row="7" Grid.Column="1"></xctk:DateTimePicker>
<!--todo-->
</Grid>
</StackPanel>

View file

@ -24,7 +24,7 @@
<Setter Property="Margin" Value="2,2,5,5" />
</Style>
<Style TargetType="ComboBox" BasedOn="{StaticResource CommonStyle}"></Style>
</Window.Resources>
<Grid>
<DockPanel LastChildFill="True">
@ -67,7 +67,7 @@
</StackPanel>
</TabItem.Header>
<controls:TextSettingsControl></controls:TextSettingsControl>
</TabItem>
<TabItem>
<TabItem.Header>
@ -182,12 +182,15 @@
<GroupBox DockPanel.Dock="Right" Header="Statistiche">
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<Button Content="Carica Impostazioni" Command="{Binding ImportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}"></Button>
<Button Content="Salva Impostazioni" Command="{Binding ExportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}"></Button>
<Button Content="Carica Impostazioni" Command="{Binding ImportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
<Button Content="Salva Impostazioni" Command="{Binding ExportSettingsCommand}" Style="{DynamicResource SquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
</StackPanel>
<Button Content="Start" Command="{Binding StartCommand}" Style="{DynamicResource AccentedSquareButtonStyle}"></Button>
<Button Content="Start" Command="{Binding StartCommand}" Style="{DynamicResource AccentedSquareButtonStyle}" IsEnabled="{Binding IsUiActive}"></Button>
<Button Content="STOP" Command="{Binding StopCommand}" Style="{DynamicResource SquareButtonStyle}"/>
<TextBlock Text="{Binding CurrentImage}"></TextBlock>
<TextBlock Text="{Binding TotalPictures}"></TextBlock>
</StackPanel>
</GroupBox>
</StackPanel>

View file

@ -1,12 +1,15 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CatalogLib;
using GalaSoft.MvvmLight.Command;
using MaddoLibrary.Base.Log;
using MaddoLibrary.Helpers;
using WPFCatalog.Messages;
@ -40,6 +43,7 @@ namespace WPFCatalog
public RelayCommand OpenDestinationFolderCommand { get; private set; }
public RelayCommand StartCommand { get; private set; }
public RelayCommand StopCommand { get; private set; }
public RelayCommand PickFontCommand { get; private set; }
@ -55,6 +59,8 @@ namespace WPFCatalog
OpenDestinationFolderCommand = new RelayCommand(OpenDestinationFolder);
StartCommand = new RelayCommand(Start);
StopCommand = new RelayCommand(Stop);
PickFontCommand = new RelayCommand(PickFont);
}
@ -76,19 +82,179 @@ namespace WPFCatalog
//string s = d.Name;
}
private void Start()
private struct ImageTask
{
public Task TaskImage;
public string ImageName;
public bool Completed;
}
private Task _workTask;
//private List<ImageTask> _tasks;
private async void Start()
{
//Task outerTask = new Task(() =>
//{
// Stopwatch s = new Stopwatch();
// var tasks = new List<Task>();
// // todo folder mode
// MaddoLogger.Log("Starting elaboration");
// foreach (var file in Directory.EnumerateFiles(PicSettings.DirectorySorgente))
// {
// //Task t = new Task(() =>
// //{
// // //CompleteFile(file);
// //});
// var t = FileTask(file);
// if (t != null)
// {
// tasks.Add(t);
// }
// else
// {
// MaddoLogger.LogError("Task was null for file: {0}", file);
// }
// //_tasks.Add(new ImageTask() { ImageName = file, TaskImage = t, Completed = false });
// //t.Start();
// }
// s.Start();
// await Task.WhenAll(tasks);
// Task.WhenAll(tasks).Start();
// s.Stop();
// //tt.RunSynchronously();
// MaddoLogger.Log("Finished: {0}, {1}", s.Elapsed, s.ElapsedMilliseconds);
// DialogHelper.PopUpAlert($"Finished: {s.Elapsed}, {s.ElapsedMilliseconds}", "message");
//});
if (/*_workTask == null || _workTask.IsCanceled || _workTask.IsCompleted || _workTask.IsFaulted*/!_isRunning)
{
_workTask = OuterTask();
try
{
await _workTask;
}
catch (TaskCanceledException e)
{
MaddoLogger.LogError(e);
MaddoLogger.LogError("Master Task cancelled");
//throw;
}
}
}
private void Stop()
{
if (_isRunning)
{
_tokenSource.Cancel();
}
}
private CancellationTokenSource _tokenSource;
private bool _isRunning = false;
private async Task OuterTask()
{
_isRunning = true;
_tokenSource = new CancellationTokenSource();
var token = _tokenSource.Token;
var tasks = new ConcurrentBag<Task>();
IsUiActive = false;
Stopwatch s = new Stopwatch();
//var tasks = new List<Task>();
// todo folder mode
MaddoLogger.Log("Starting elaboration");
var files = Directory.EnumerateFiles(PicSettings.DirectorySorgente).ToArray();
TotalPictures = files.Count();
IImageProcessor i = new ImgSharpCreator();
foreach (var file in files)
{
//Task t = new Task(() =>
//{
// //CompleteFile(file);
//});
var t = FileTask(file, i, token);
tasks.Add(t);
//_tasks.Add(new ImageTask() { ImageName = file, TaskImage = t, Completed = false });
//t.Start();
}
s.Start();
try
{
await Task.WhenAll(tasks);
}
catch (AggregateException e)
{
MaddoLogger.LogError(e);
MaddoLogger.LogError("Task cancelled");
//Console.WriteLine(e);
//Console.WriteLine("Task cancelled");
//throw;
}
finally
{
_tokenSource.Dispose();
//Task.WhenAll(tasks).Start();
s.Stop();
//tt.RunSynchronously();
MaddoLogger.Log("Finished: {0}, {1}", s.Elapsed, s.ElapsedMilliseconds);
DialogHelper.PopUpAlert($"Finished: {s.Elapsed}, {s.ElapsedMilliseconds}", "message");
IsUiActive = true;
_isRunning = false;
}
}
private async Task FileTask(string file, IImageProcessor i, CancellationToken token)
{
if (token.IsCancellationRequested == true)
{
token.ThrowIfCancellationRequested();
}
MaddoLogger.Log("Starting task for image {0}", file);
//IImageProcessor i = new ImgSharpCreator();
await Task.Run(() => i.Start(new FileInfo(file)), token);
CurrentImage = file;
TotalPictures--;
}
private void CompleteFile(string file)
{
// todo folder mode
foreach (var file in Directory.EnumerateFiles(PicSettings.DirectorySorgente))
{
IImageProcessor i = new ImgSharpCreator();
//ImageCreator2 i = new ImageCreator2();
i.Start(new FileInfo(file));
}
DialogHelper.PopUpAlert("Finished", "message");
}
private void OpenSourceFolder()
@ -164,6 +330,30 @@ namespace WPFCatalog
#region Proprietà
private bool _isUiActive = true;
public bool IsUiActive
{
get => _isUiActive;
set { _isUiActive = value; RaisePropertyChanged("IsUiActive"); }
}
private string _currentImage;
public string CurrentImage
{
get => _currentImage;
set { _currentImage = value; RaisePropertyChanged("CurrentImage"); }
}
private int _totalPictures;
public int TotalPictures
{
get => _totalPictures;
set { _totalPictures = value; RaisePropertyChanged("TotalPictures"); }
}
public PicSettings SettingsString
{
get { return PicSettings; }
@ -291,6 +481,16 @@ namespace WPFCatalog
}
}
public bool FotoRidimensiona
{
get { return PicSettings.FotoRidimensiona; }
set
{
PicSettings.FotoRidimensiona = value;
RaisePropertyChanged("FotoRidimensiona");
}
}
public int FotoAltezza
{
get
@ -671,7 +871,52 @@ namespace WPFCatalog
}
}
public bool Threading
{
get => PicSettings.Threading;
set { PicSettings.Threading = value; RaisePropertyChanged("Threading"); }
}
public int Margine
{
get => PicSettings.Margine;
set { PicSettings.Margine = value; RaisePropertyChanged("Margine"); }
}
public Positions TextPosition
{
get => PicSettings.TextPosition;
set { PicSettings.TextPosition = value; RaisePropertyChanged("TextPosition"); }
}
public Alignments TextAlignment
{
get => PicSettings.TextAlignment;
set { PicSettings.TextAlignment = value; RaisePropertyChanged("TextAlignment"); }
}
public ResizeModes ResizeMode
{
get => PicSettings.ResizeMode;
set { PicSettings.ResizeMode = value; RaisePropertyChanged("ResizeMode"); }
}
public ResizeDimensions ResizeDimension
{
get => PicSettings.ResizeDimension;
set { PicSettings.ResizeDimension = value; RaisePropertyChanged("ResizeDimension"); }
}
public bool Grassetto
{
get => PicSettings.Grassetto;
set { PicSettings.Grassetto = value; RaisePropertyChanged("Grassetto"); }
}
//public PicSettings.Positions Positions
//{
// get => PicSettings.Positions;
//}
#endregion
@ -687,7 +932,7 @@ namespace WPFCatalog
public string ColoreTestoRGB
{
{
get { return PicSettings.ColoreTestoRGB; }
set
{

View file

@ -66,14 +66,6 @@
<Reference Include="GalaSoft.MvvmLight.WPF45">
<HintPath>..\packages\MvvmLightLibs.4.1.27.1\lib\net45\GalaSoft.MvvmLight.WPF45.dll</HintPath>
</Reference>
<Reference Include="MaddoLibrary.Base.NET45, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\MaddoLibrary.Base.NET45.dll</HintPath>
</Reference>
<Reference Include="MaddoLibrary.WPF.NET46, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\MaddoLibrary.WPF.NET46.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.5.0.23, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
@ -86,9 +78,8 @@
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="ReachFramework" />
<Reference Include="System" />
<Reference Include="System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
<Private>True</Private>
<Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.4.0\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
@ -233,6 +224,14 @@
<Project>{d27accf2-80fc-4de8-aeb8-351ff076e6d5}</Project>
<Name>CatalogLib</Name>
</ProjectReference>
<ProjectReference Include="..\MaddoLibrary\MaddoLibrary.Base.NET46\MaddoLibrary.Base.NET46.csproj">
<Project>{e93daae6-4aa9-4a45-afb6-58209b3ad3c9}</Project>
<Name>MaddoLibrary.Base.NET46</Name>
</ProjectReference>
<ProjectReference Include="..\MaddoLibrary\MaddoLibrary.WPF.NET46\MaddoLibrary.WPF.NET46.csproj">
<Project>{73da19d7-196d-4b16-b610-93250978a607}</Project>
<Name>MaddoLibrary.WPF.NET46</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\document-open-folder.png" />

View file

@ -6,5 +6,5 @@
<package id="MahApps.Metro.IconPacks" version="1.9.0" targetFramework="net46" />
<package id="MvvmLight" version="4.1.27.1" targetFramework="net45" />
<package id="MvvmLightLibs" version="4.1.27.1" targetFramework="net45" />
<package id="System.Collections.Immutable" version="1.3.1" targetFramework="net46" />
<package id="System.Collections.Immutable" version="1.4.0" targetFramework="net46" />
</packages>

View file

@ -331,6 +331,12 @@
<Name>MaddoShared</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="collini_canon.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LOG_ITA.jpg" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PreBuildEvent>

BIN
imagecatalog/LOG_ITA.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,5 @@
Imports System.IO
Public Class ParametriSetup
@ -22,6 +24,10 @@ Public Class ParametriSetup
_ElencoParametri = LeggiXmlDataSet("Setup", _NomeFileSetup, "Nome")
End Sub
public sub CaricaParametriSetupStream(ByVal stream As Stream)
_ElencoParametri = LeggiXmlDataSetStream("Setup", stream, "Nome")
End sub
Public Sub SalvaParametriSetup()
If System.IO.File.Exists(_NomeFileSetup) = True Then
Kill(_NomeFileSetup)
@ -118,11 +124,12 @@ Public Class ParametriSetup
Return DataSetXml.Tables(NomeTabella)
End Function
Private Shared Function LeggiXmlDataSet(ByVal NomeTabella As String, ByVal NomeFileXml As String, Optional ByVal NomeColonnaChiave As String = "") As DataSet
Private Shared Function LeggiXmlDataSetStream(ByVal NomeTabella As String, ByVal stream As Stream, Optional ByVal NomeColonnaChiave As String = "") As DataSet
'* Crea e Legge il dataset dal file xml
Dim DataSetXml As New System.Data.DataSet
DataSetXml.ReadXml(NomeFileXml)
'DataSetXml.ReadXml(NomeFileXml)
DataSetXml.ReadXml(stream)
'* Aggiunge il campo chiave
If NomeColonnaChiave <> "" Then
DataSetXml.Tables(NomeTabella).Constraints.Add(NomeColonnaChiave, DataSetXml.Tables(NomeTabella).Columns(NomeColonnaChiave), True)
@ -132,7 +139,19 @@ Public Class ParametriSetup
Return DataSetXml
End Function
Private Shared Function LeggiXmlDataSet(ByVal NomeTabella As String, ByVal NomeFileXml As String, Optional ByVal NomeColonnaChiave As String = "") As DataSet
'* Crea e Legge il dataset dal file xml
Dim DataSetXml As New System.Data.DataSet
DataSetXml.ReadXml(NomeFileXml)
'* Aggiunge il campo chiave
If NomeColonnaChiave <> "" Then
DataSetXml.Tables(NomeTabella).Constraints.Add(NomeColonnaChiave, DataSetXml.Tables(NomeTabella).Columns(NomeColonnaChiave), True)
End If
'* Restituisce la risposta
Return DataSetXml
End Function
Public Property NomeFileSetup() As String

View file

@ -0,0 +1,248 @@
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<Setup>
<Nome>DirSorgente</Nome>
<Valore />
</Setup>
<Setup>
<Nome>DirDestinazione</Nome>
<Valore />
</Setup>
<Setup>
<Nome>DirSottoDirectory</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>DirDividiDestinazione</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>DirDividiNumFile</Nome>
<Valore>200</Valore>
</Setup>
<Setup>
<Nome>DirDividiSuffisso</Nome>
<Valore />
</Setup>
<Setup>
<Nome>DirDividiNumCifre</Nome>
<Valore>2</Valore>
</Setup>
<Setup>
<Nome>DirDividiTipoNumerazione</Nome>
<Valore>Progressiva</Valore>
</Setup>
<Setup>
<Nome>MiniatureCrea</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>MiniatureSuffisso</Nome>
<Valore>tn_</Valore>
</Setup>
<Setup>
<Nome>MiniatureAltezza</Nome>
<Valore>350</Valore>
</Setup>
<Setup>
<Nome>MiniatureLarghezza</Nome>
<Valore>350</Valore>
</Setup>
<Setup>
<Nome>MiniatureAddScritta</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>FotoAltezza</Nome>
<Valore>2240</Valore>
</Setup>
<Setup>
<Nome>FotoLarghezza</Nome>
<Valore>2240</Valore>
</Setup>
<Setup>
<Nome>FotoCodice</Nome>
<Valore />
</Setup>
<Setup>
<Nome>FotoDimOriginali</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>FontDimensione</Nome>
<Valore>110</Valore>
</Setup>
<Setup>
<Nome>FontBold</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>FontNome</Nome>
<Valore>Verdana</Valore>
</Setup>
<Setup>
<Nome>TestoTesto</Nome>
<Valore />
</Setup>
<Setup>
<Nome>TestoTrasparente</Nome>
<Valore>0</Valore>
</Setup>
<Setup>
<Nome>TestoMargine</Nome>
<Valore>6</Valore>
</Setup>
<Setup>
<Nome>TestoPosizione</Nome>
<Valore>Basso</Valore>
</Setup>
<Setup>
<Nome>TestoAllineamento</Nome>
<Valore>Centro</Valore>
</Setup>
<Setup>
<Nome>MarchioFile</Nome>
<Valore>C:\catalog_1\LOGO.jpg</Valore>
</Setup>
<Setup>
<Nome>MarchioAltezza</Nome>
<Valore>500</Valore>
</Setup>
<Setup>
<Nome>MarchioLarghezza</Nome>
<Valore>500</Valore>
</Setup>
<Setup>
<Nome>MarchioMargine</Nome>
<Valore>250</Valore>
</Setup>
<Setup>
<Nome>MarchioAllOrizzontale</Nome>
<Valore>Destra</Valore>
</Setup>
<Setup>
<Nome>MarchioAllVerticale</Nome>
<Valore>Alto</Valore>
</Setup>
<Setup>
<Nome>MarchioTrasparenza</Nome>
<Valore>100</Valore>
</Setup>
<Setup>
<Nome>MarchioAggiungi</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>TempoGara</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>Orario</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>EtichettaOrario</Nome>
<Valore />
</Setup>
<Setup>
<Nome>GeneraleForzaJpg</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>GeneraleRotazioneAutomatica</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>MiniatureAddOrario</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>FontColoreR</Nome>
<Valore>255</Valore>
</Setup>
<Setup>
<Nome>FontColoreG</Nome>
<Valore>255</Valore>
</Setup>
<Setup>
<Nome>FontColoreB</Nome>
<Valore>0</Valore>
</Setup>
<Setup>
<Nome>FontDimensioneMiniatura</Nome>
<Valore>200</Valore>
</Setup>
<Setup>
<Nome>GrandezzaVerticale</Nome>
<Valore>110</Valore>
</Setup>
<Setup>
<Nome>MargineVerticale</Nome>
<Valore>6</Valore>
</Setup>
<Setup>
<Nome>DimensioniOriginali</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>TestoVerticale</Nome>
<Valore xml:space="preserve">
</Valore>
</Setup>
<Setup>
<Nome>NomeMiatura</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>DataFoto</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>NumeroFoto</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>NomeMiniatura</Nome>
<Valore>True</Valore>
</Setup>
<Setup>
<Nome>SegretoSmall</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>SegretoBig</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>SegretoDefault</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>PathSmall</Nome>
<Valore />
</Setup>
<Setup>
<Nome>PathBig</Nome>
<Valore />
</Setup>
<Setup>
<Nome>TempoSmall</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>NumTempoSmall</Nome>
<Valore>False</Valore>
</Setup>
<Setup>
<Nome>ColoreTestoRGB</Nome>
<Valore>Yellow</Valore>
</Setup>
<Setup>
<Nome>CompressioneJpeg</Nome>
<Valore>85</Valore>
</Setup>
<Setup>
<Nome>CompressioneJpegMiniatura</Nome>
<Valore>30</Valore>
</Setup>
</NewDataSet>