From da71a0a75586f64fa938a1210610690ca004567f Mon Sep 17 00:00:00 2001 From: Maddo Date: Thu, 23 Mar 2017 14:36:06 +0100 Subject: [PATCH] Moved to x64 --- Catalog.sln | 36 ++++--- CatalogLib/CatalogLib.csproj | 30 ++++-- CatalogLib/ImgSharpCreator.cs | 38 +++++++- CatalogLib/PicSettings.cs | 18 +++- CatalogLib/packages.config | 8 +- CatalogVbLib/CatalogVbLib.vbproj | 21 +++++ ImageCatalogCS/ImageCatalog 3.csproj | 20 ++++ WPFCatalog/App.config | 1 + WPFCatalog/App.xaml | 4 +- .../Controls/GeneralSettingsControl.xaml | 9 +- WPFCatalog/MainWindowViewModel.cs | 16 +++- WPFCatalog/WPFCatalog.csproj | 93 +++++++++++++++++++ WPFCatalog/packages.config | 53 +++++++++++ 13 files changed, 308 insertions(+), 39 deletions(-) diff --git a/Catalog.sln b/Catalog.sln index 9e1b1a9..0833825 100644 --- a/Catalog.sln +++ b/Catalog.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.26228.9 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ImageCatalog 2", "imagecatalog\ImageCatalog 2.vbproj", "{8D3AA2B0-8F06-4A61-9CAD-B920EB1A8E9C}" EndProject @@ -39,46 +39,54 @@ Global {8D3AA2B0-8F06-4A61-9CAD-B920EB1A8E9C}.Release|x86.Build.0 = Release|x86 {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|x64.ActiveCfg = Debug|x64 + {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|x64.Build.0 = Debug|x64 {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Debug|x86.ActiveCfg = Debug|Any CPU {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|Any CPU.Build.0 = Release|Any CPU - {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|x64.ActiveCfg = Release|Any CPU + {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|x64.ActiveCfg = Release|x64 + {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|x64.Build.0 = Release|x64 {D11ED7B0-93E8-4F38-A142-EED72D7EE8B5}.Release|x86.ActiveCfg = Release|Any CPU {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|x64.ActiveCfg = Debug|x64 + {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|x64.Build.0 = Debug|x64 {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Debug|x86.ActiveCfg = Debug|Any CPU {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|Any CPU.ActiveCfg = Release|Any CPU {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|Any CPU.Build.0 = Release|Any CPU - {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|x64.ActiveCfg = Release|Any CPU + {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|x64.ActiveCfg = Release|x64 + {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|x64.Build.0 = Release|x64 {D27ACCF2-80FC-4DE8-AEB8-351FF076E6D5}.Release|x86.ActiveCfg = Release|Any CPU {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|Any CPU.Build.0 = Debug|Any CPU - {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|x64.ActiveCfg = Debug|Any CPU + {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|x64.ActiveCfg = Debug|x64 + {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|x64.Build.0 = Debug|x64 {638DE501-CECA-4744-B293-7AE93CAEEB01}.Debug|x86.ActiveCfg = Debug|Any CPU {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|Any CPU.ActiveCfg = Release|Any CPU {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|Any CPU.Build.0 = Release|Any CPU - {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|x64.ActiveCfg = Release|Any CPU + {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|x64.ActiveCfg = Release|x64 + {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|x64.Build.0 = Release|x64 {638DE501-CECA-4744-B293-7AE93CAEEB01}.Release|x86.ActiveCfg = Release|Any CPU {44465926-240D-473F-90B8-786BA4384406}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {44465926-240D-473F-90B8-786BA4384406}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44465926-240D-473F-90B8-786BA4384406}.Debug|x64.ActiveCfg = Debug|Any CPU + {44465926-240D-473F-90B8-786BA4384406}.Debug|x64.ActiveCfg = Debug|x64 + {44465926-240D-473F-90B8-786BA4384406}.Debug|x64.Build.0 = Debug|x64 {44465926-240D-473F-90B8-786BA4384406}.Debug|x86.ActiveCfg = Debug|Any CPU {44465926-240D-473F-90B8-786BA4384406}.Release|Any CPU.ActiveCfg = Release|Any CPU {44465926-240D-473F-90B8-786BA4384406}.Release|Any CPU.Build.0 = Release|Any CPU - {44465926-240D-473F-90B8-786BA4384406}.Release|x64.ActiveCfg = Release|Any CPU + {44465926-240D-473F-90B8-786BA4384406}.Release|x64.ActiveCfg = Release|x64 + {44465926-240D-473F-90B8-786BA4384406}.Release|x64.Build.0 = Release|x64 {44465926-240D-473F-90B8-786BA4384406}.Release|x86.ActiveCfg = Release|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.ActiveCfg = Debug|Any CPU - {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.Build.0 = Debug|Any CPU + {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.ActiveCfg = Debug|x64 + {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x64.Build.0 = Debug|x64 {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x86.ActiveCfg = Debug|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Debug|x86.Build.0 = Debug|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Release|Any CPU.ActiveCfg = Release|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Release|Any CPU.Build.0 = Release|Any CPU - {73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.ActiveCfg = Release|Any CPU - {73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.Build.0 = Release|Any CPU + {73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.ActiveCfg = Release|x64 + {73DA19D7-196D-4B16-B610-93250978A607}.Release|x64.Build.0 = Release|x64 {73DA19D7-196D-4B16-B610-93250978A607}.Release|x86.ActiveCfg = Release|Any CPU {73DA19D7-196D-4B16-B610-93250978A607}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection diff --git a/CatalogLib/CatalogLib.csproj b/CatalogLib/CatalogLib.csproj index 97c3989..9e429d3 100644 --- a/CatalogLib/CatalogLib.csproj +++ b/CatalogLib/CatalogLib.csproj @@ -34,18 +34,30 @@ prompt 4 + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + - ..\packages\ImageSharp.1.0.0-alpha3-00005\lib\netstandard1.3\ImageSharp.dll + ..\packages\ImageSharp.1.0.0-alpha4-00046\lib\netstandard1.3\ImageSharp.dll - ..\packages\ImageSharp.Drawing.1.0.0-alpha3-00005\lib\netstandard1.1\ImageSharp.Drawing.dll - - - ..\packages\ImageSharp.Drawing.Paths.1.0.0-alpha2-00107\lib\net45\ImageSharp.Drawing.Paths.dll - - - ..\packages\ImageSharp.Drawing.Text.1.0.0-alpha2-00003\lib\net45\ImageSharp.Drawing.Text.dll + ..\packages\ImageSharp.Drawing.1.0.0-alpha4-00046\lib\netstandard1.1\ImageSharp.Drawing.dll ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll @@ -58,7 +70,7 @@ ..\packages\SixLabors.Fonts.0.1.0-alpha0002\lib\netstandard1.3\SixLabors.Fonts.dll - ..\packages\SixLabors.Shapes.0.1.0-alpha0008\lib\netstandard1.1\SixLabors.Shapes.dll + ..\packages\SixLabors.Shapes.0.1.0-alpha0009\lib\netstandard1.1\SixLabors.Shapes.dll diff --git a/CatalogLib/ImgSharpCreator.cs b/CatalogLib/ImgSharpCreator.cs index 96a59c8..38bcb33 100644 --- a/CatalogLib/ImgSharpCreator.cs +++ b/CatalogLib/ImgSharpCreator.cs @@ -1,18 +1,29 @@ 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 SixLabors.Fonts; +using Color = ImageSharp.Color; +using Font = SixLabors.Fonts.Font; +using FontFamily = SixLabors.Fonts.FontFamily; +using FontStyle = SixLabors.Fonts.FontStyle; +using Image = ImageSharp.Image; namespace CatalogLib { public class ImgSharpCreator : IImageProcessor { + private FileInfo _currentFile; public void Start(FileInfo workFile) { + _currentFile = workFile; using (Image image = new Image(workFile.FullName)) { if (PicSettings.Instance.UsaRotazioneAutomatica) @@ -68,16 +79,39 @@ namespace CatalogLib } + SetExtraText(image); + //JpegDecoder j = new JpegDecoder(); + var va = Vector.IsHardwareAccelerated; + + 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.Resize(200, 200).Save(""); } } - private void SetExtraText(ref Image image) + private void SetExtraText(Image image) { - //if () + if (string.IsNullOrWhiteSpace(PicSettings.Instance.TestoApplicareOrizzontale)) + { + Debug.WriteLine($"{_currentFile.Name} No text"); + return; + } + var fff = FontCollection.SystemFonts.Find(PicSettings.Instance.NomeFont); + //var fff = FontCollection.SystemFonts.Find("Segoe Print"); + + var font = new Font(fff, (float) PicSettings.Instance.DimensioneFont, FontStyle.Regular); + //var font = new Font(fff, 8f, FontStyle.Regular); + + + image.DrawText(PicSettings.Instance.TestoApplicareOrizzontale, font, Color.Black, new Vector2(200, 200)); + //image.DrawText("sssssssssssssssssssssssssssssssssssssssssssssss", font, Color.Black, new Vector2(200, 200)); + } } } diff --git a/CatalogLib/PicSettings.cs b/CatalogLib/PicSettings.cs index af92f44..33f02b7 100644 --- a/CatalogLib/PicSettings.cs +++ b/CatalogLib/PicSettings.cs @@ -142,7 +142,7 @@ namespace CatalogLib // setdouble default } - return (T)_settingsDict[key]; + return (T)_settingsDict[key]; } @@ -302,7 +302,7 @@ namespace CatalogLib public bool GeneraleRotazioneAutomatica { - get { return GetBool("GeneraleRotazioneAutomatica"); } + get { return GetBool("GeneraleRotazioneAutomatica", true); } set { SetBool("GeneraleRotazioneAutomatica", value); } } @@ -378,7 +378,7 @@ namespace CatalogLib set { SetString("FotoSuffisso", value); } } - + public bool EnableThumbnails { get { return GetBool("EnableThumbnails", false); } @@ -410,6 +410,18 @@ namespace CatalogLib set { SetDouble("dimensioneFont", value); } } + public string TestoApplicareOrizzontale + { + get + { + return Get("TestoApplicareOrizzontale", ""); + } + set + { + Set("TestoApplicareOrizzontale", value); + } + } + #endregion diff --git a/CatalogLib/packages.config b/CatalogLib/packages.config index 0c0fd12..9909fb0 100644 --- a/CatalogLib/packages.config +++ b/CatalogLib/packages.config @@ -1,15 +1,13 @@  - - - - + + - + diff --git a/CatalogVbLib/CatalogVbLib.vbproj b/CatalogVbLib/CatalogVbLib.vbproj index 638fdd4..efab3b3 100644 --- a/CatalogVbLib/CatalogVbLib.vbproj +++ b/CatalogVbLib/CatalogVbLib.vbproj @@ -46,6 +46,27 @@ On + + true + true + true + bin\x64\Debug\ + CatalogVbLib.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + full + x64 + MinimumRecommendedRules.ruleset + + + true + bin\x64\Release\ + CatalogVbLib.xml + true + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + pdbonly + x64 + MinimumRecommendedRules.ruleset + diff --git a/ImageCatalogCS/ImageCatalog 3.csproj b/ImageCatalogCS/ImageCatalog 3.csproj index e134fca..993bc20 100644 --- a/ImageCatalogCS/ImageCatalog 3.csproj +++ b/ImageCatalogCS/ImageCatalog 3.csproj @@ -35,6 +35,26 @@ prompt 4 + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + diff --git a/WPFCatalog/App.config b/WPFCatalog/App.config index 433728a..fecd1c7 100644 --- a/WPFCatalog/App.config +++ b/WPFCatalog/App.config @@ -4,6 +4,7 @@ + diff --git a/WPFCatalog/App.xaml b/WPFCatalog/App.xaml index 33082dc..9388e68 100644 --- a/WPFCatalog/App.xaml +++ b/WPFCatalog/App.xaml @@ -1,5 +1,5 @@ - + @@ -16,5 +16,5 @@ - + \ No newline at end of file diff --git a/WPFCatalog/Controls/GeneralSettingsControl.xaml b/WPFCatalog/Controls/GeneralSettingsControl.xaml index 1c35da3..9f511c8 100644 --- a/WPFCatalog/Controls/GeneralSettingsControl.xaml +++ b/WPFCatalog/Controls/GeneralSettingsControl.xaml @@ -106,7 +106,7 @@ - + @@ -117,6 +117,7 @@ + @@ -125,11 +126,11 @@ diff --git a/WPFCatalog/MainWindowViewModel.cs b/WPFCatalog/MainWindowViewModel.cs index 7de24c0..d92f81d 100644 --- a/WPFCatalog/MainWindowViewModel.cs +++ b/WPFCatalog/MainWindowViewModel.cs @@ -721,10 +721,24 @@ namespace WPFCatalog } } + public string TestoApplicareOrizzontale + { + get + { + return PicSettings.TestoApplicareOrizzontale; + + } + set + { + PicSettings.TestoApplicareOrizzontale = value; + RaisePropertyChanged("TestoApplicareOrizzontale"); + } + + } //todo: bold - //todo: italic + //todo: italic #endregion #region Logo diff --git a/WPFCatalog/WPFCatalog.csproj b/WPFCatalog/WPFCatalog.csproj index 5f05904..9a8e7b6 100644 --- a/WPFCatalog/WPFCatalog.csproj +++ b/WPFCatalog/WPFCatalog.csproj @@ -38,6 +38,26 @@ prompt 4 + + true + bin\x64\Debug\ + DEBUG;TRACE + full + x64 + prompt + MinimumRecommendedRules.ruleset + true + + + bin\x64\Release\ + TRACE + true + pdbonly + x64 + prompt + MinimumRecommendedRules.ruleset + true + @@ -55,15 +75,85 @@ ..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll + + ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + + + ..\packages\SixLabors.Fonts.0.1.0-alpha0002\lib\netstandard1.3\SixLabors.Fonts.dll + + + ..\packages\SixLabors.Shapes.0.1.0-alpha0009\lib\netstandard1.1\SixLabors.Shapes.dll + + + ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll + + + ..\packages\System.Buffers.4.3.0\lib\netstandard1.1\System.Buffers.dll + + + ..\packages\System.Collections.Immutable.1.3.1\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll + True + + + + ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll + + + ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + + ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + + + ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll + + + + ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + + + ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll + + + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + + + ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + + + ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + + + + ..\packages\System.Numerics.Vectors.4.3.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.3.0\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net46\System.Security.Cryptography.Algorithms.dll + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net46\System.Security.Cryptography.X509Certificates.dll + ..\packages\MahApps.Metro.1.4.3\lib\net45\System.Windows.Interactivity.dll @@ -76,6 +166,9 @@ 4.0 + + ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + diff --git a/WPFCatalog/packages.config b/WPFCatalog/packages.config index 1bf0af3..2ea2b0e 100644 --- a/WPFCatalog/packages.config +++ b/WPFCatalog/packages.config @@ -4,6 +4,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file