Removed visual basic lib dependency
This commit is contained in:
parent
65aeabdfee
commit
ab33d4558f
11 changed files with 102 additions and 2084 deletions
|
|
@ -10,12 +10,10 @@ using System.Runtime.CompilerServices;
|
|||
using System.Security;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualBasic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Windows.Forms;
|
||||
using CatalogVbLib;
|
||||
using MaddoShared;
|
||||
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
|
||||
|
||||
// Imports System.Threading
|
||||
|
|
@ -57,7 +55,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
private float yPosFromBottom3;
|
||||
private float yPosFromBottom4;
|
||||
|
||||
private ExifReader.Orientations _orientation;
|
||||
private Orientations _orientation;
|
||||
private DateTime? _creationDate;
|
||||
|
||||
public ImageCreatorSharp()
|
||||
|
|
@ -144,7 +142,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
private void ExtractExif()
|
||||
{
|
||||
using var img = SixLabors.ImageSharp.Image.Load(_workFile.FullName);
|
||||
_orientation = ExifReader.Orientations.TopLeft;
|
||||
_orientation = Orientations.TopLeft;
|
||||
|
||||
IExifValue<ushort> rotation = null;
|
||||
|
||||
|
|
@ -153,7 +151,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
if (found )
|
||||
{
|
||||
var intOrientation = rotation.Value.ToInt32();
|
||||
_orientation = (ExifReader.Orientations)intOrientation;
|
||||
_orientation = (Orientations)intOrientation;
|
||||
}
|
||||
|
||||
IExifValue<string> date = null;
|
||||
|
|
@ -191,16 +189,16 @@ public class ImageCreatorSharp : IDisposable
|
|||
|
||||
switch (_orientation /*DatiExif.Orientation*/)
|
||||
{
|
||||
case ExifReader.Orientations.BottomLeft:
|
||||
case ExifReader.Orientations.BottomRight:
|
||||
case ExifReader.Orientations.LeftTop:
|
||||
case ExifReader.Orientations.LftBottom:
|
||||
case Orientations.BottomLeft:
|
||||
case Orientations.BottomRight:
|
||||
case Orientations.LeftTop:
|
||||
case Orientations.LftBottom:
|
||||
FotoRuotaASinistra = true;
|
||||
break;
|
||||
case ExifReader.Orientations.RightBottom:
|
||||
case ExifReader.Orientations.RightTop:
|
||||
case ExifReader.Orientations.TopLeft:
|
||||
case ExifReader.Orientations.TopRight:
|
||||
case Orientations.RightBottom:
|
||||
case Orientations.RightTop:
|
||||
case Orientations.TopLeft:
|
||||
case Orientations.TopRight:
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
@ -422,7 +420,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
StrFormat1.Alignment = StringAlignment.Center;
|
||||
|
||||
SolidBrush semiTransBrush21 = new SolidBrush(Color.FromArgb(alphaScelta, 0, 0, 0));
|
||||
SolidBrush semiTransBrush1 = new SolidBrush(Color.FromArgb(alphaScelta, PicSettings.fontColoreRGB));
|
||||
SolidBrush semiTransBrush1 = new SolidBrush(Color.FromArgb(alphaScelta, PicSettings.FontColoreRGB));
|
||||
|
||||
// quick fix
|
||||
DimensioneStandardMiniatura = PicSettings.DimMin;
|
||||
|
|
@ -608,7 +606,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
|
||||
SolidBrush semiTransBrush2 = new SolidBrush(Color.FromArgb(alphaScelta, 0, 0, 0));
|
||||
// Dim semiTransBrush As SolidBrush = New SolidBrush(Color.FromArgb(AlphaScelta, _FontColoreR, _FontColoreG, _FontColoreB))
|
||||
SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(alphaScelta, PicSettings.fontColoreRGB));
|
||||
SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(alphaScelta, PicSettings.FontColoreRGB));
|
||||
|
||||
if (FotoRuotaADestra | FotoRuotaASinistra)
|
||||
{
|
||||
|
|
@ -800,7 +798,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
thumbSizeBig = g2.Width > g2.Height ? NewthumbSize(g2.Width, g2.Height, PicSettings.LarghezzaBig, "Larghezza") : NewthumbSize(g2.Width, g2.Height, PicSettings.AltezzaBig, "Altezza");
|
||||
using Bitmap imgOutputBig2 = new Bitmap(g2, thumbSizeBig.Width, thumbSizeBig.Height);
|
||||
if (thisFormat.Equals(ImageFormat.Jpeg))
|
||||
SalvaImmagineCustomQuality(imgOutputBig2, Path.Combine(DestDir.FullName, NomeFileBig), PicSettings.jpegQuality);
|
||||
SalvaImmagineCustomQuality(imgOutputBig2, Path.Combine(DestDir.FullName, NomeFileBig), PicSettings.JpegQuality);
|
||||
else
|
||||
imgOutputBig2.Save(Path.Combine(DestDir.FullName, NomeFileBig), thisFormat);
|
||||
|
||||
|
|
@ -813,7 +811,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
{
|
||||
//
|
||||
if (thisFormat.Equals(ImageFormat.Jpeg))
|
||||
SalvaImmagineCustomQuality(imgOutputBig, Path.Combine(DestDir.FullName, NomeFileBig), PicSettings.jpegQuality);
|
||||
SalvaImmagineCustomQuality(imgOutputBig, Path.Combine(DestDir.FullName, NomeFileBig), PicSettings.JpegQuality);
|
||||
else
|
||||
imgOutputBig.Save(Path.Combine(DestDir.FullName, NomeFileBig), thisFormat);
|
||||
|
||||
|
|
@ -837,7 +835,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
NomeFileSmall = NomeFileSmall.Substring(0, NomeFileSmall.Length - 4) + PicSettings.Codice + NomeFileSmall.Substring(NomeFileSmall.Length - 4);
|
||||
//
|
||||
if (thisFormat.Equals(ImageFormat.Jpeg))
|
||||
SalvaImmagineCustomQuality(imgOutputSmall, Path.Combine(DestDir.FullName, NomeFileSmall), PicSettings.jpegQualityMin);
|
||||
SalvaImmagineCustomQuality(imgOutputSmall, Path.Combine(DestDir.FullName, NomeFileSmall), PicSettings.JpegQualityMin);
|
||||
else
|
||||
imgOutputSmall.Save(Path.Combine(_DestDir.FullName, NomeFileSmall), thisFormat);
|
||||
|
||||
|
|
@ -858,7 +856,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
|
||||
EncoderParameters MyEncoderParameters = new EncoderParameters(1);
|
||||
|
||||
EncoderParameter MyEncoderParameter = new EncoderParameter(MyEncoder, PicSettings.jpegQuality);
|
||||
EncoderParameter MyEncoderParameter = new EncoderParameter(MyEncoder, PicSettings.JpegQuality);
|
||||
MyEncoderParameters.Param[0] = MyEncoderParameter;
|
||||
imageToSave.Save(nomeFileFinale, JgpEncoder, MyEncoderParameters);
|
||||
//imageToSave.Dispose();
|
||||
|
|
@ -871,7 +869,7 @@ public class ImageCreatorSharp : IDisposable
|
|||
|
||||
EncoderParameters MyEncoderParameters = new EncoderParameters(1);
|
||||
|
||||
EncoderParameter MyEncoderParameter = new EncoderParameter(MyEncoder, PicSettings.jpegQuality);
|
||||
EncoderParameter MyEncoderParameter = new EncoderParameter(MyEncoder, PicSettings.JpegQuality);
|
||||
MyEncoderParameters.Param[0] = MyEncoderParameter;
|
||||
destinationStream.Seek(0, SeekOrigin.Begin);
|
||||
imageToSave.Save(destinationStream, JgpEncoder, MyEncoderParameters);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue