diff --git a/Mk0.Software.ImageSorter/App.config b/Mk0.Software.ImageSorter/App.config index aa65d8e..161ff3f 100644 --- a/Mk0.Software.ImageSorter/App.config +++ b/Mk0.Software.ImageSorter/App.config @@ -1,21 +1,21 @@ - -
-
+ +
+
- + - + - + True @@ -38,10 +38,10 @@ - + - + True diff --git a/Mk0.Software.ImageSorter/EXIF.Designer.cs b/Mk0.Software.ImageSorter/EXIF.Designer.cs new file mode 100644 index 0000000..0f02559 --- /dev/null +++ b/Mk0.Software.ImageSorter/EXIF.Designer.cs @@ -0,0 +1,64 @@ +namespace Mk0.Software.ImageSorter +{ + partial class EXIF + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.treeViewExif = new System.Windows.Forms.TreeView(); + this.SuspendLayout(); + // + // treeViewExif + // + this.treeViewExif.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.treeViewExif.Location = new System.Drawing.Point(12, 12); + this.treeViewExif.Name = "treeViewExif"; + this.treeViewExif.Size = new System.Drawing.Size(343, 367); + this.treeViewExif.TabIndex = 1; + // + // EXIF + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(367, 391); + this.Controls.Add(this.treeViewExif); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EXIF"; + this.ShowIcon = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "EXIF"; + this.Shown += new System.EventHandler(this.EXIF_Shown); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.TreeView treeViewExif; + } +} \ No newline at end of file diff --git a/Mk0.Software.ImageSorter/EXIF.cs b/Mk0.Software.ImageSorter/EXIF.cs new file mode 100644 index 0000000..30e9fc9 --- /dev/null +++ b/Mk0.Software.ImageSorter/EXIF.cs @@ -0,0 +1,607 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.Drawing.Imaging; + +namespace Mk0.Software.ImageSorter +{ + public partial class EXIF : Form + { + private List exifData; + + public EXIF(PropertyItem[] propertyItems) + { + InitializeComponent(); + exifData = new List(); + foreach (PropertyItem propItem in propertyItems) + { + Exifdata ed = new Exifdata(propItem.Id, propItem.Type, propItem.Len, propItem.Value); + exifData.Add(ed); + } + } + + private void EXIF_Shown(object sender, EventArgs e) + { + treeViewExif.BeginUpdate(); + foreach (Exifdata ed in exifData) + { + if (ed.ID != "ThumbnailData") + { + TreeNode node = new TreeNode(ed.ID); + node.Nodes.Add(new TreeNode(ed.Value)); + + node.Nodes.Add(new TreeNode(ed.Type)); + node.Nodes.Add(new TreeNode(ed.Length)); + + treeViewExif.Nodes.Add(node); + node.Expand(); + } + } + treeViewExif.TreeViewNodeSorter = new Sorter(); + treeViewExif.Sort(); + treeViewExif.EndUpdate(); + } + } + + public class Exifdata + { + private const string DOUBLETYPE_FORMAT = "0.0####"; + private const int BYTEJUMP_SHORT = 2; + private const int BYTEJUMP_LONG = 4; + private const int BYTEJUMP_RATIONAL = 8; + private const int BYTEJUMP_SLONG = 4; + private const int BYTEJUMP_SRATIONAL = 8; + public string ID, Type, Length, Value; + public short TypeOriginal; + + public Exifdata(int id, short type, int len, byte[] value) + { + ID = new Exifid("0x" + id.ToString("x4")).Readable; + TypeOriginal = type; + Type = ExifType(type); + Length = len.ToString() + " bytes"; + Value = ExifValue(value, type, len); + } + + public string ExifValue(byte[] value, short type, int len) + { + ASCIIEncoding encoding = new ASCIIEncoding(); + string ev = ""; + + if (type == 1) + { + ev = BitConverter.ToString(value, 0, len); + } + else if (type == 2) + { + ev = encoding.GetString(value, 0, len - 1); + } + else if (type == 3) + { + for (int i = 0; i < len; i = i + BYTEJUMP_SHORT) + { + ushort val = BitConverter.ToUInt16(value, i); + ev += val.ToString(); + if (i + BYTEJUMP_SHORT < len) + ev += " "; + } + } + else if (type == 4) + { + for (int i = 0; i < len; i = i + BYTEJUMP_LONG) + { + uint val = BitConverter.ToUInt32(value, i); + ev += val.ToString(); + if (i + BYTEJUMP_LONG < len) + ev += " "; + } + } + else if (type == 5) + { + for (int i = 0; i < len; i = i + BYTEJUMP_RATIONAL) + { + uint numer = BitConverter.ToUInt32(value, i); + uint denom = BitConverter.ToUInt32(value, i + BYTEJUMP_LONG); + //if (formatInstr == FormatInstr.FRACTION) + if(false) + { + UFraction frac = new UFraction(numer, denom); + ev += frac.ToString(); + } + else + { + double dbl; + if (denom == 0) + dbl = 0.0; + else + dbl = (double)numer / (double)denom; + ev += dbl.ToString(DOUBLETYPE_FORMAT); + } + if (i + BYTEJUMP_RATIONAL < len) + ev += " "; + } + } + else if (type == 6) + { + //if (formatInstr == FormatInstr.ALLCHAR) + if (false) + { + ev = encoding.GetString(value, 0, len); + } + else + { + ev = BitConverter.ToString(value, 0, len); + } + } + else if (type == 7) + { + try + { + for (int i = 0; i < len; i = i + BYTEJUMP_SLONG) + { + int val = BitConverter.ToInt32(value, i); + ev += val.ToString(); + if (i + BYTEJUMP_SLONG < len) + ev += " "; + } + } + catch (Exception ex) + { + ev = ex.ToString(); + } + } + else if (type == 10) + { + for (int i = 0; i < len; i = i + BYTEJUMP_SRATIONAL) + { + int numer = BitConverter.ToInt32(value, i); + int denom = BitConverter.ToInt32(value, i + BYTEJUMP_SLONG); + //if (formatInstr == FormatInstr.FRACTION) + if (false) + { + Fraction frac = new Fraction(numer, denom); + ev += frac.ToString(); + } + else + { + double dbl; + if (denom == 0) + dbl = 0.0; + else + dbl = (double)numer / (double)denom; + ev += dbl.ToString(DOUBLETYPE_FORMAT); + } + if (i + BYTEJUMP_SRATIONAL < len) + ev += " "; + } + } + else + { + ev = "unlesbarer Typ"; + } + + return ev; + } + + public string ExifType(short type) + { + switch (type) + { + case 1: + return "unsigned array of bytes"; + case 2: + return "ASCII string"; + case 3: + return "array of unsigned short (16-bit) integers"; + case 4: + return "array of unsigned long (32-bit) integers"; + case 5: + return "array of pairs of unsigned long integers"; + case 6: + return "signed array of bytes"; + case 7: + return "array of signed long (32-bit) integers"; + case 10: + return "array of pairs of signed long integers"; + default: + return "unknown"; + } + } + } + + public class Exifid + { + public string Readable; + public Dictionary ids = new Dictionary(); + + public Exifid(string id) + { + ids.Add("0x0000", "GPS Version"); + ids.Add("0x0001", "GPS Latitude Nord- oder Südhalbkugel"); + ids.Add("0x0002", "GPS Latitude"); + ids.Add("0x0003", "GPS Longitude Ost oder West"); + ids.Add("0x0004", "GPS Longitude"); + ids.Add("0x0005", "GPS AltitudeRef"); + ids.Add("0x0006", "GPS Altitude"); + ids.Add("0x0007", "GPS Time"); + ids.Add("0x0008", "GPS Satellites"); + ids.Add("0x0009", "GPS Status"); + ids.Add("0x000a", "GPS MeasureMode"); + ids.Add("0x000b", "GPS Dop"); + ids.Add("0x000c", "GPS SpeedRef"); + ids.Add("0x000d", "GPS Speed"); + ids.Add("0x000e", "GPS TrackRef"); + ids.Add("0x000f", "GPS Track"); + ids.Add("0x0010", "GPS ImgDirRef"); + ids.Add("0x0011", "GPS ImgDir"); + ids.Add("0x0012", "GPS MapDatum"); + ids.Add("0x0013", "GPS DestLatRef"); + ids.Add("0x0014", "GPS DestLat"); + ids.Add("0x0015", "GPS DestLongRef"); + ids.Add("0x0016", "GPS DestLong"); + ids.Add("0x0017", "GPS DestBearRef"); + ids.Add("0x0018", "GPS DestBear"); + ids.Add("0x0019", "GPS DestDistRef"); + ids.Add("0x001a", "GPS DestDist"); + ids.Add("0x00fe", "NewSubfileType"); + ids.Add("0x00ff", "SubfileType"); + ids.Add("0x0100", "ImageWidth"); + ids.Add("0x0101", "ImageHeight"); + ids.Add("0x0102", "BitsPerSample"); + ids.Add("0x0103", "Compression"); + ids.Add("0x0106", "PhotometricInterp"); + ids.Add("0x0107", "ThreshHolding"); + ids.Add("0x0108", "CellWidth"); + ids.Add("0x0109", "CellHeight"); + ids.Add("0x010a", "FillOrder"); + ids.Add("0x010d", "DocumentName"); + ids.Add("0x010e", "ImageDescription"); + ids.Add("0x010f", "EquipMake"); + ids.Add("0x0110", "EquipModel"); + ids.Add("0x0111", "StripOffsets"); + ids.Add("0x0112", "Orientation"); + ids.Add("0x0115", "SamplesPerPixel"); + ids.Add("0x0116", "RowsPerStrip"); + ids.Add("0x0117", "StripBytesCount"); + ids.Add("0x0118", "MinSampleValue"); + ids.Add("0x0119", "MaxSampleValue"); + ids.Add("0x011a", "XResolution"); + ids.Add("0x011b", "YResolution"); + ids.Add("0x011c", "PlanarConfig"); + ids.Add("0x011d", "PageName"); + ids.Add("0x011e", "XPosition"); + ids.Add("0x011f", "YPosition"); + ids.Add("0x0120", "FreeOffset"); + ids.Add("0x0121", "FreeByteCounts"); + ids.Add("0x0122", "GrayResponseUnit"); + ids.Add("0x0123", "GrayResponseCurve"); + ids.Add("0x0124", "T4Option"); + ids.Add("0x0125", "T6Option"); + ids.Add("0x0128", "ResolutionUnit"); + ids.Add("0x0129", "PageNumber"); + ids.Add("0x012d", "TransferFunction"); + ids.Add("0x0131", "SoftwareUsed"); + ids.Add("0x0132", "DateTime"); + ids.Add("0x013b", "Artist"); + ids.Add("0x013c", "HostComputer"); + ids.Add("0x013d", "Predictor"); + ids.Add("0x013e", "WhitePoint"); + ids.Add("0x013f", "PrimaryChromaticities"); + ids.Add("0x0140", "ColorMap"); + ids.Add("0x0141", "HalftoneHints"); + ids.Add("0x0142", "TileWidth"); + ids.Add("0x0143", "TileLength"); + ids.Add("0x0144", "TileOffset"); + ids.Add("0x0145", "TileByteCounts"); + ids.Add("0x014c", "InkSet"); + ids.Add("0x014d", "InkNames"); + ids.Add("0x014e", "NumberOfInks"); + ids.Add("0x0150", "DotRange"); + ids.Add("0x0151", "TargetPrinter"); + ids.Add("0x0152", "ExtraSamples"); + ids.Add("0x0153", "SampleFormat"); + ids.Add("0x0154", "SMinSampleValue"); + ids.Add("0x0155", "SMaxSampleValue"); + ids.Add("0x0156", "TransferRange"); + ids.Add("0x0200", "JPEGProc"); + ids.Add("0x0201", "JPEGInterFormat"); + ids.Add("0x0202", "JPEGInterLength"); + ids.Add("0x0203", "JPEGRestartInterval"); + ids.Add("0x0205", "JPEGLosslessPredictors"); + ids.Add("0x0206", "JPEGPointTransforms"); + ids.Add("0x0207", "JPEGQTables"); + ids.Add("0x0208", "JPEGDCTables"); + ids.Add("0x0209", "JPEGACTables"); + ids.Add("0x0211", "YCbCrCoefficients"); + ids.Add("0x0212", "YCbCrSubsampling"); + ids.Add("0x0213", "YCbCrPositioning"); + ids.Add("0x0214", "REFBlackWhite"); + ids.Add("0x0301", "Gamma"); + ids.Add("0x0302", "ICCProfileDescriptor"); + ids.Add("0x0303", "SRGBRenderingIntent"); + ids.Add("0x0320", "ImageTitle"); + ids.Add("0x5001", "ResolutionXUnit"); + ids.Add("0x5002", "ResolutionYUnit"); + ids.Add("0x5003", "ResolutionXLengthUnit"); + ids.Add("0x5004", "ResolutionYLengthUnit"); + ids.Add("0x5005", "PrintFlags"); + ids.Add("0x5006", "PrintFlagsVersion"); + ids.Add("0x5007", "PrintFlagsCrop"); + ids.Add("0x5008", "PrintFlagsBleedWidth"); + ids.Add("0x5009", "PrintFlagsBleedWidthScale"); + ids.Add("0x500a", "HalftoneLPI"); + ids.Add("0x500b", "HalftoneLPIUnit"); + ids.Add("0x500c", "HalftoneDegree"); + ids.Add("0x500d", "HalftoneShape"); + ids.Add("0x500e", "HalftoneMisc"); + ids.Add("0x500f", "HalftoneScreen"); + ids.Add("0x5010", "JPEGQuality"); + ids.Add("0x5011", "GridSize"); + ids.Add("0x5012", "ThumbnailFormat"); + ids.Add("0x5013", "ThumbnailWidth"); + ids.Add("0x5014", "ThumbnailHeight"); + ids.Add("0x5015", "ThumbnailColorDepth"); + ids.Add("0x5016", "ThumbnailPlanes"); + ids.Add("0x5017", "ThumbnailRawBytes"); + ids.Add("0x5018", "ThumbnailSize"); + ids.Add("0x5019", "ThumbnailCompressedSize"); + ids.Add("0x501a", "ColorTransferFunction"); + ids.Add("0x501b", "ThumbnailData"); + ids.Add("0x5020", "ThumbnailImageWidth"); + ids.Add("0x5021", "ThumbnailImageHeight"); + ids.Add("0x5022", "ThumbnailBitsPerSample"); + ids.Add("0x5023", "ThumbnailCompression"); + ids.Add("0x5024", "ThumbnailPhotometricInterp"); + ids.Add("0x5025", "ThumbnailImageDescription"); + ids.Add("0x5026", "ThumbnailEquipMake"); + ids.Add("0x5027", "ThumbnailEquipModel"); + ids.Add("0x5028", "ThumbnailStripOffsets"); + ids.Add("0x5029", "ThumbnailOrientation"); + ids.Add("0x502a", "ThumbnailSamplesPerPixel"); + ids.Add("0x502b", "ThumbnailRowsPerStrip"); + ids.Add("0x502c", "ThumbnailStripBytesCount"); + ids.Add("0x502d", "ThumbnailResolutionX"); + ids.Add("0x502e", "ThumbnailResolutionY"); + ids.Add("0x502f", "ThumbnailPlanarConfig"); + ids.Add("0x5030", "ThumbnailResolutionUnit"); + ids.Add("0x5031", "ThumbnailTransferFunction"); + ids.Add("0x5032", "ThumbnailSoftwareUsed"); + ids.Add("0x5033", "ThumbnailDateTime"); + ids.Add("0x5034", "ThumbnailArtist"); + ids.Add("0x5035", "ThumbnailWhitePoint"); + ids.Add("0x5036", "ThumbnailPrimaryChromaticities"); + ids.Add("0x5037", "ThumbnailYCbCrCoefficients"); + ids.Add("0x5038", "ThumbnailYCbCrSubsampling"); + ids.Add("0x5039", "ThumbnailYCbCrPositioning"); + ids.Add("0x503a", "ThumbnailRefBlackWhite"); + ids.Add("0x503b", "ThumbnailCopyRight"); + ids.Add("0x5041", "InteroperabilityIndex"); + ids.Add("0x5042", "ExifInteroperabilityVersion"); + ids.Add("0x5090", "LuminanceTable"); + ids.Add("0x5091", "ChrominanceTable"); + ids.Add("0x5100", "FrameDelay"); + ids.Add("0x5101", "LoopCount"); + ids.Add("0x5102", "GlobalPalette"); + ids.Add("0x5103", "IndexBackground"); + ids.Add("0x5104", "IndexTransparent"); + ids.Add("0x5110", "PixelUnit"); + ids.Add("0x5111", "PixelPerUnitX"); + ids.Add("0x5112", "PixelPerUnitY"); + ids.Add("0x5113", "PaletteHistogram"); + ids.Add("0x8298", "Copyright"); + ids.Add("0x829a", "ExifExposureTime"); + ids.Add("0x829d", "ExifFNumber"); + ids.Add("0x8769", "ExifIFD"); + ids.Add("0x8773", "ICCProfile"); + ids.Add("0x8822", "ExifExposureProg"); + ids.Add("0x8824", "ExifSpectralSense"); + ids.Add("0x8825", "GPS IFD"); + ids.Add("0x8827", "ExifISOSpeed"); + ids.Add("0x8828", "ExifOECF"); + ids.Add("0x9000", "ExifVer"); + ids.Add("0x9003", "ExifDTOrig"); + ids.Add("0x9004", "ExifDTDigitized"); + ids.Add("0x9101", "ExifCompConfig"); + ids.Add("0x9102", "ExifCompBPP"); + ids.Add("0x9201", "ExifShutterSpeed"); + ids.Add("0x9202", "ExifAperture"); + ids.Add("0x9203", "ExifBrightness"); + ids.Add("0x9204", "ExifExposureBias"); + ids.Add("0x9205", "ExifMaxAperture"); + ids.Add("0x9206", "ExifSubjectDist"); + ids.Add("0x9207", "ExifMeteringMode"); + ids.Add("0x9208", "ExifLightSource"); + ids.Add("0x9209", "ExifFlash"); + ids.Add("0x920a", "ExifFocalLength"); + ids.Add("0x927c", "ExifMakerNote"); + ids.Add("0x9286", "ExifUserComment"); + ids.Add("0x9290", "ExifDTSubsec"); + ids.Add("0x9291", "ExifDTOrigSS"); + ids.Add("0x9292", "ExifDTDigSS"); + ids.Add("0xa000", "ExifFPXVer"); + ids.Add("0xa001", "ExifColorSpace"); + ids.Add("0xa002", "ExifPixXDim"); + ids.Add("0xa003", "ExifPixYDim"); + ids.Add("0xa004", "ExifRelatedWav"); + ids.Add("0xa005", "ExifInterop"); + ids.Add("0xa20b", "ExifFlashEnergy"); + ids.Add("0xa20c", "ExifSpatialFR"); + ids.Add("0xa20e", "ExifFocalXRes"); + ids.Add("0xa20f", "ExifFocalYRes"); + ids.Add("0xa210", "ExifFocalResUnit"); + ids.Add("0xa214", "ExifSubjectLoc"); + ids.Add("0xa215", "ExifExposureIndex"); + ids.Add("0xa217", "ExifSensingMethod"); + ids.Add("0xa300", "ExifFileSource"); + ids.Add("0xa301", "ExifSceneType"); + ids.Add("0xa302", "ExifCfaPattern"); + ids.Add("0xa402", "ExposureMode"); + ids.Add("0xa403", "WhiteBalance"); + ids.Add("0xa404", "DigitalZoomRatio"); + ids.Add("0xa405", "FocalLengthIn35mmFilm"); + ids.Add("0xa406", "SceneCaptureType"); + ids.Add("0xa407", "GainControl"); + ids.Add("0xa408", "Contrast"); + ids.Add("0xa409", "Saturation"); + ids.Add("0xa40a", "Sharpness"); + ids.Add("0xa40c", "SubjectDistanceRange"); + + if (ids.TryGetValue(id.ToLower(), out Readable)) + { + // + } + else + { + Readable = id; + } + } + } + + public class Fraction + { + private Int32 _numer; + private Int32 _denom; + + public Fraction(Int32 numer, Int32 denom) + { + _numer = numer; + _denom = denom; + } + + /// + /// Converts the signed numerator and denominator values + /// to its equivalent string representation. + /// A fraction (x/y) is returned when applicable. + public override string ToString() + { + Int32 numer = _numer; + Int32 denom = (_denom == 0) ? 1 : _denom; + + // Make the numerator "store" the sign + if (denom < 0) + { + numer = numer * -1; + denom = denom * -1; + } + + Reduce(ref numer, ref denom); + + string result; + if (numer == 0) + result = "0"; + else if (denom == 1) + result = numer + ""; + else + result = numer + "/" + denom; + + return result; + } + + /// + /// Reduces the rational number by dividing both the numerator + /// and the denominator by their greatest common divisor. + private static void Reduce(ref Int32 numer, ref Int32 denom) + { + if (numer != 0) + { + Int32 common = GCD(Math.Abs(numer), denom); + + numer = numer / common; + denom = denom / common; + } + } + + /// + /// Computes and returns the greatest common divisor of the two + /// positive parameters. Uses Euclid's algorithm. + private static Int32 GCD(Int32 num1, Int32 num2) + { + while (num1 != num2) + if (num1 > num2) + num1 = num1 - num2; + else + num2 = num2 - num1; + + return num1; + } + } + + public class UFraction + { + private UInt32 _numer; + private UInt32 _denom; + + public UFraction(UInt32 numer, UInt32 denom) + { + _numer = numer; + _denom = denom; + } + + /// + /// Converts the unsigned numerator and denominator values + /// to its equivalent string representation. + /// A fraction is used when applicable. + public override string ToString() + { + UInt32 numer = _numer; + UInt32 denom = (_denom == 0) ? 1 : _denom; + + Reduce(ref numer, ref denom); + + string result; + if (numer == 0) + result = "0"; + else if (denom == 1) + result = numer + ""; + else + result = numer + "/" + denom; + + return result; + } + + /// + /// Reduces the rational number by dividing both the numerator + /// and the denominator by their greatest common divisor. + private static void Reduce(ref UInt32 numer, ref UInt32 denom) + { + if (numer != 0) + { + UInt32 common = GCD(numer, denom); + + numer = numer / common; + denom = denom / common; + } + } + + /// + /// Computes and returns the greatest common divisor of the two + /// positive parameters. Uses Euclid's algorithm. + private static UInt32 GCD(UInt32 num1, UInt32 num2) + { + while (num1 != num2) + if (num1 > num2) + num1 = num1 - num2; + else + num2 = num2 - num1; + + return num1; + } + } + + public class Sorter : System.Collections.IComparer + { + public int Compare(object x, object y) + { + TreeNode tx = x as TreeNode; + TreeNode ty = y as TreeNode; + + // If this is a child node, preserve the same order by comparing the node Index, not the text + if (tx.Parent != null && ty.Parent != null) + return tx.Index - ty.Index; + + // This is a root node, compare by name. + return string.Compare(tx.Text, ty.Text); + } + } +} diff --git a/Mk0.Software.ImageSorter/EXIF.resx b/Mk0.Software.ImageSorter/EXIF.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/Mk0.Software.ImageSorter/EXIF.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Mk0.Software.ImageSorter/Main.Designer.cs b/Mk0.Software.ImageSorter/Main.Designer.cs index 9fcdae5..353f45b 100644 --- a/Mk0.Software.ImageSorter/Main.Designer.cs +++ b/Mk0.Software.ImageSorter/Main.Designer.cs @@ -36,6 +36,7 @@ this.toolStripMenuItemEditImage = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemOpenExplorer = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemImageDetails = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItemShowEXIF = new System.Windows.Forms.ToolStripMenuItem(); this.buttonSettings = new System.Windows.Forms.Button(); this.labelQuellPath = new System.Windows.Forms.Label(); this.groupBoxInformationen = new System.Windows.Forms.GroupBox(); @@ -121,45 +122,53 @@ this.toolStripMenuItemCropImage, this.toolStripMenuItemEditImage, this.toolStripMenuItemOpenExplorer, - this.toolStripMenuItemImageDetails}); + this.toolStripMenuItemImageDetails, + this.toolStripMenuItemShowEXIF}); this.contextMenuStrip.Name = "contextMenuStrip"; - this.contextMenuStrip.Size = new System.Drawing.Size(196, 92); + this.contextMenuStrip.Size = new System.Drawing.Size(206, 114); // // toolStripMenuItemCropImage // this.toolStripMenuItemCropImage.Name = "toolStripMenuItemCropImage"; - this.toolStripMenuItemCropImage.Size = new System.Drawing.Size(195, 22); + this.toolStripMenuItemCropImage.Size = new System.Drawing.Size(205, 22); this.toolStripMenuItemCropImage.Text = "Bild zuschneiden (F2)"; this.toolStripMenuItemCropImage.Click += new System.EventHandler(this.BildZuschneidenToolStripMenuItem_Click); // // toolStripMenuItemEditImage // this.toolStripMenuItemEditImage.Name = "toolStripMenuItemEditImage"; - this.toolStripMenuItemEditImage.Size = new System.Drawing.Size(195, 22); + this.toolStripMenuItemEditImage.Size = new System.Drawing.Size(205, 22); this.toolStripMenuItemEditImage.Text = "Bild bearbeiten (F3)"; this.toolStripMenuItemEditImage.Click += new System.EventHandler(this.ToolStripMenuItemEditImage_Click); // // toolStripMenuItemOpenExplorer // this.toolStripMenuItemOpenExplorer.Name = "toolStripMenuItemOpenExplorer"; - this.toolStripMenuItemOpenExplorer.Size = new System.Drawing.Size(195, 22); + this.toolStripMenuItemOpenExplorer.Size = new System.Drawing.Size(205, 22); this.toolStripMenuItemOpenExplorer.Text = "Speicherort öffnen (F4)"; this.toolStripMenuItemOpenExplorer.Click += new System.EventHandler(this.ToolStripMenuItemOpenExplorer_Click); // // toolStripMenuItemImageDetails // this.toolStripMenuItemImageDetails.Name = "toolStripMenuItemImageDetails"; - this.toolStripMenuItemImageDetails.Size = new System.Drawing.Size(195, 22); + this.toolStripMenuItemImageDetails.Size = new System.Drawing.Size(205, 22); this.toolStripMenuItemImageDetails.Text = "Bildeigenschaften (F5)"; this.toolStripMenuItemImageDetails.Click += new System.EventHandler(this.ToolStripMenuItemImageDetails_Click); // + // toolStripMenuItemShowEXIF + // + this.toolStripMenuItemShowEXIF.Name = "toolStripMenuItemShowEXIF"; + this.toolStripMenuItemShowEXIF.Size = new System.Drawing.Size(205, 22); + this.toolStripMenuItemShowEXIF.Text = "EXIF-Daten anzeigen (F6)"; + this.toolStripMenuItemShowEXIF.Click += new System.EventHandler(this.ToolStripMenuItemShowEXIF_Click); + // // buttonSettings // this.buttonSettings.Font = new System.Drawing.Font("Webdings", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(2))); this.buttonSettings.Location = new System.Drawing.Point(233, 16); this.buttonSettings.Name = "buttonSettings"; this.buttonSettings.Size = new System.Drawing.Size(23, 23); - this.buttonSettings.TabIndex = 1; + this.buttonSettings.TabIndex = 7; this.buttonSettings.Text = "@"; this.buttonSettings.UseVisualStyleBackColor = true; this.buttonSettings.Click += new System.EventHandler(this.ButtonSettings_Click); @@ -213,7 +222,7 @@ this.buttonQuellPfad.Location = new System.Drawing.Point(204, 16); this.buttonQuellPfad.Name = "buttonQuellPfad"; this.buttonQuellPfad.Size = new System.Drawing.Size(23, 23); - this.buttonQuellPfad.TabIndex = 4; + this.buttonQuellPfad.TabIndex = 6; this.buttonQuellPfad.Text = "1"; this.buttonQuellPfad.UseVisualStyleBackColor = true; this.buttonQuellPfad.Click += new System.EventHandler(this.ButtonQuellPfad_Click); @@ -243,7 +252,7 @@ this.buttonLastImage.Location = new System.Drawing.Point(105, 16); this.buttonLastImage.Name = "buttonLastImage"; this.buttonLastImage.Size = new System.Drawing.Size(23, 23); - this.buttonLastImage.TabIndex = 9; + this.buttonLastImage.TabIndex = 4; this.buttonLastImage.Text = "I"; this.buttonLastImage.UseVisualStyleBackColor = true; this.buttonLastImage.Visible = false; @@ -256,7 +265,7 @@ this.buttonInfo.Location = new System.Drawing.Point(175, 16); this.buttonInfo.Name = "buttonInfo"; this.buttonInfo.Size = new System.Drawing.Size(23, 23); - this.buttonInfo.TabIndex = 8; + this.buttonInfo.TabIndex = 5; this.buttonInfo.Text = "i"; this.buttonInfo.UseVisualStyleBackColor = true; this.buttonInfo.Click += new System.EventHandler(this.ButtonInfo_Click); @@ -267,7 +276,7 @@ this.buttonJumpBack.Location = new System.Drawing.Point(6, 16); this.buttonJumpBack.Name = "buttonJumpBack"; this.buttonJumpBack.Size = new System.Drawing.Size(23, 23); - this.buttonJumpBack.TabIndex = 7; + this.buttonJumpBack.TabIndex = 1; this.buttonJumpBack.Text = "ç"; this.buttonJumpBack.UseVisualStyleBackColor = true; this.buttonJumpBack.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ButtonJumpBack_Click); @@ -304,7 +313,7 @@ this.buttonJumpForward.Location = new System.Drawing.Point(35, 16); this.buttonJumpForward.Name = "buttonJumpForward"; this.buttonJumpForward.Size = new System.Drawing.Size(23, 23); - this.buttonJumpForward.TabIndex = 1; + this.buttonJumpForward.TabIndex = 2; this.buttonJumpForward.Text = "è"; this.buttonJumpForward.UseVisualStyleBackColor = true; this.buttonJumpForward.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ButtonJumpForward_Click); @@ -316,7 +325,7 @@ this.buttonUndo.Location = new System.Drawing.Point(64, 16); this.buttonUndo.Name = "buttonUndo"; this.buttonUndo.Size = new System.Drawing.Size(23, 23); - this.buttonUndo.TabIndex = 2; + this.buttonUndo.TabIndex = 3; this.buttonUndo.Text = "Õ"; this.buttonUndo.UseVisualStyleBackColor = true; this.buttonUndo.Click += new System.EventHandler(this.ButtonUndo_Click); @@ -327,7 +336,7 @@ this.buttonDeleteImage.Location = new System.Drawing.Point(6, 538); this.buttonDeleteImage.Name = "buttonDeleteImage"; this.buttonDeleteImage.Size = new System.Drawing.Size(95, 23); - this.buttonDeleteImage.TabIndex = 5; + this.buttonDeleteImage.TabIndex = 10; this.buttonDeleteImage.Text = "Löschen"; this.buttonDeleteImage.UseVisualStyleBackColor = true; this.buttonDeleteImage.Click += new System.EventHandler(this.ImageDelete); @@ -602,7 +611,7 @@ this.buttonDuplicate.Location = new System.Drawing.Point(220, 538); this.buttonDuplicate.Name = "buttonDuplicate"; this.buttonDuplicate.Size = new System.Drawing.Size(95, 23); - this.buttonDuplicate.TabIndex = 16; + this.buttonDuplicate.TabIndex = 12; this.buttonDuplicate.Tag = ""; this.buttonDuplicate.Text = "Duplizieren"; this.buttonDuplicate.UseVisualStyleBackColor = true; @@ -630,7 +639,7 @@ this.buttonTransformation.Location = new System.Drawing.Point(113, 538); this.buttonTransformation.Name = "buttonTransformation"; this.buttonTransformation.Size = new System.Drawing.Size(95, 23); - this.buttonTransformation.TabIndex = 18; + this.buttonTransformation.TabIndex = 11; this.buttonTransformation.Tag = ""; this.buttonTransformation.Text = "Transformation"; this.buttonTransformation.UseVisualStyleBackColor = true; @@ -642,7 +651,7 @@ this.buttonHintergrund.Location = new System.Drawing.Point(327, 538); this.buttonHintergrund.Name = "buttonHintergrund"; this.buttonHintergrund.Size = new System.Drawing.Size(95, 23); - this.buttonHintergrund.TabIndex = 19; + this.buttonHintergrund.TabIndex = 13; this.buttonHintergrund.Tag = ""; this.buttonHintergrund.Text = "hell/dunkel"; this.buttonHintergrund.UseVisualStyleBackColor = true; @@ -654,7 +663,7 @@ this.buttonRander.Location = new System.Drawing.Point(434, 538); this.buttonRander.Name = "buttonRander"; this.buttonRander.Size = new System.Drawing.Size(95, 23); - this.buttonRander.TabIndex = 20; + this.buttonRander.TabIndex = 14; this.buttonRander.Tag = ""; this.buttonRander.Text = "Ränder"; this.buttonRander.UseVisualStyleBackColor = true; @@ -684,7 +693,7 @@ this.MinimumSize = new System.Drawing.Size(983, 605); this.Name = "Main"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Image Sorter v1.42 | © 2015-2019 by manuelkamper.com"; + this.Text = "Image Sorter v1.43 | © 2015-2020 by manuelkamper.com"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Main_FormClosing); this.Load += new System.EventHandler(this.Main_Load); this.Shown += new System.EventHandler(this.Main_Shown); @@ -762,5 +771,6 @@ private System.Windows.Forms.Button buttonRandUnten; private System.Windows.Forms.Button buttonRandOben; private System.Windows.Forms.TrackBar trackBarRander; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemShowEXIF; } } diff --git a/Mk0.Software.ImageSorter/Main.cs b/Mk0.Software.ImageSorter/Main.cs index dae8ef0..3b69fc2 100644 --- a/Mk0.Software.ImageSorter/Main.cs +++ b/Mk0.Software.ImageSorter/Main.cs @@ -620,7 +620,7 @@ namespace Mk0.Software.ImageSorter var result = form.ShowDialog(); if (result == DialogResult.Yes) { - fullTargetPath = Path.Combine(targetPath, Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation) + Randomize.NumberAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation)); + fullTargetPath = Path.Combine(targetPath, Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation) + Randomize.NumbersAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation)); } else if (result == DialogResult.No) { @@ -1060,7 +1060,7 @@ namespace Mk0.Software.ImageSorter } /// - /// Öffnet im Explorer den Ordner des Bildes + /// Öffnet im Explorer den Ordner des Bildes und legt den Fokus auf das aktuelle Bild, wenn es existiert /// /// /// @@ -1078,7 +1078,7 @@ namespace Mk0.Software.ImageSorter } /// - /// Zeigt Details zum Bild an + /// Zeigt Details (Eigenschaften) zum aktuellen Bild an /// /// /// @@ -1102,6 +1102,20 @@ namespace Mk0.Software.ImageSorter } } + /// + /// Zeigt die EXIF-Daten vom aktuellen Bild an + /// + /// + /// + private void ToolStripMenuItemShowEXIF_Click(object sender, EventArgs e) + { + using (Image img = Image.FromFile(pictureBoxImage.ImageLocation)) + { + EXIF exif = new EXIF(img.PropertyItems); + exif.ShowDialog(); + } + } + /// /// Öffnet Paint zum Bearbeiten des Bildes /// @@ -1144,16 +1158,12 @@ namespace Mk0.Software.ImageSorter } /// - /// Temporäre Dateien beim Beenden löschen + /// Größe, Position in Settings speichern vor dem Schließen /// /// /// private void Main_FormClosing(object sender, FormClosingEventArgs e) { - if (Directory.Exists("C:/img-tmp")) - { - Directory.Delete("C:/img-tmp", true); - } Properties.Settings.Default.lastPath = quellPath; Properties.Settings.Default.lastWidth = Width; Properties.Settings.Default.lastHeight = Height; @@ -1287,6 +1297,12 @@ namespace Mk0.Software.ImageSorter e.Handled = true; } + if (e.KeyCode == Keys.F6) + { + toolStripMenuItemShowEXIF.PerformClick(); + e.Handled = true; + } + if (e.KeyCode == Keys.Back) { buttonUndo.PerformClick(); @@ -1406,7 +1422,7 @@ namespace Mk0.Software.ImageSorter private void ButtonDuplicate_Click(object sender, EventArgs e) { //aktuelles bild kopieren - string targetPath = Path.Combine(Path.GetDirectoryName(pictureBoxImage.ImageLocation), Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation) + Randomize.NumberAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation)); + string targetPath = Path.Combine(Path.GetDirectoryName(pictureBoxImage.ImageLocation), Path.GetFileNameWithoutExtension(pictureBoxImage.ImageLocation) + Randomize.NumbersAndDigits(5, "_") + Path.GetExtension(pictureBoxImage.ImageLocation)); File.Copy(pictureBoxImage.ImageLocation, targetPath, true); //duplikat als nächstes bild in liste aufnehmen diff --git a/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj b/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj index aec1afd..4c214e2 100644 --- a/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj +++ b/Mk0.Software.ImageSorter/Mk0.Software.ImageSorter.csproj @@ -9,7 +9,7 @@ Properties Mk0.Software.ImageSorter Image Sorter - v4.6.1 + v4.7.2 512 false Svn @@ -33,7 +33,7 @@ manuelkamper.com false 0 - 1.42.0.0 + 1.43.0.0 true true true @@ -77,24 +77,19 @@ - ..\..\Mk0.Tools.Password\Mk0.Tools.Password\Mk0.Tools.Password\mk0.gui.banner.1.0.0\lib\net461\Mk0.GUI.Banner.dll - True + ..\packages\mk0.gui.banner.1.0.0\lib\net461\Mk0.GUI.Banner.dll - ..\..\Mk0.Tools.Password\Mk0.Tools.Password\Mk0.Tools.Password\mk0.tools.calculation.1.0.0\lib\net461\Mk0.Tools.Calculation.dll - True + ..\packages\mk0.tools.calculation.1.0.0\lib\net461\Mk0.Tools.Calculation.dll - ..\..\Mk0.Tools.Password\Mk0.Tools.Password\Mk0.Tools.Password\mk0.tools.imagecropper.1.0.0\lib\net461\Mk0.Tools.ImageCropper.dll - True + ..\packages\mk0.tools.imagecropper.1.0.0\lib\net461\Mk0.Tools.ImageCropper.dll - - ..\..\Mk0.Tools.Password\Mk0.Tools.Password\Mk0.Tools.Password\mk0.tools.images.1.0.0\lib\net461\Mk0.Tools.Images.dll - True + + ..\packages\mk0.tools.images.1.0.4\lib\net461\Mk0.Tools.Images.dll - ..\..\Mk0.Tools.Password\Mk0.Tools.Password\Mk0.Tools.Password\mk0.tools.randomization.1.0.0\lib\net461\Mk0.Tools.Randomization.dll - True + ..\packages\mk0.tools.randomization.1.0.0\lib\net461\Mk0.Tools.Randomization.dll @@ -103,6 +98,7 @@ + @@ -111,6 +107,12 @@ Cropper.cs + + Form + + + EXIF.cs + Form @@ -135,6 +137,9 @@ Cropper.cs + + EXIF.cs + Main.cs @@ -169,11 +174,6 @@ - - - - - diff --git a/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs b/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs index 09d4cf4..2f5e051 100644 --- a/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs +++ b/Mk0.Software.ImageSorter/Properties/AssemblyInfo.cs @@ -10,7 +10,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("manuelkamper.com")] [assembly: AssemblyProduct("ImageSorter")] -[assembly: AssemblyCopyright("Copyright © 2015-2019 by manuelkamper.com")] +[assembly: AssemblyCopyright("Copyright © 2015-2020 by manuelkamper.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.42.*")] +[assembly: AssemblyVersion("1.43.*")] //[assembly: AssemblyFileVersion("1.6.0.0")] diff --git a/Mk0.Software.ImageSorter/Properties/Resources.Designer.cs b/Mk0.Software.ImageSorter/Properties/Resources.Designer.cs index 4547995..86e4290 100644 --- a/Mk0.Software.ImageSorter/Properties/Resources.Designer.cs +++ b/Mk0.Software.ImageSorter/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Mk0.Software.ImageSorter.Properties { // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Mk0.Software.ImageSorter/Properties/Settings.Designer.cs b/Mk0.Software.ImageSorter/Properties/Settings.Designer.cs index 75304e4..1f5ac93 100644 --- a/Mk0.Software.ImageSorter/Properties/Settings.Designer.cs +++ b/Mk0.Software.ImageSorter/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Mk0.Software.ImageSorter.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Mk0.Software.ImageSorter/dll/Mk0.GUI.Banner.dll b/Mk0.Software.ImageSorter/dll/Mk0.GUI.Banner.dll deleted file mode 100644 index 190af6e..0000000 Binary files a/Mk0.Software.ImageSorter/dll/Mk0.GUI.Banner.dll and /dev/null differ diff --git a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Calculation.dll b/Mk0.Software.ImageSorter/dll/Mk0.Tools.Calculation.dll deleted file mode 100644 index e61c03c..0000000 Binary files a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Calculation.dll and /dev/null differ diff --git a/Mk0.Software.ImageSorter/dll/Mk0.Tools.ImageCropper.dll b/Mk0.Software.ImageSorter/dll/Mk0.Tools.ImageCropper.dll deleted file mode 100644 index ad247de..0000000 Binary files a/Mk0.Software.ImageSorter/dll/Mk0.Tools.ImageCropper.dll and /dev/null differ diff --git a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Images.dll b/Mk0.Software.ImageSorter/dll/Mk0.Tools.Images.dll deleted file mode 100644 index 5d66575..0000000 Binary files a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Images.dll and /dev/null differ diff --git a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Randomization.dll b/Mk0.Software.ImageSorter/dll/Mk0.Tools.Randomization.dll deleted file mode 100644 index 784758a..0000000 Binary files a/Mk0.Software.ImageSorter/dll/Mk0.Tools.Randomization.dll and /dev/null differ diff --git a/Mk0.Software.ImageSorter/packages.config b/Mk0.Software.ImageSorter/packages.config index 89395d6..4d8ece7 100644 --- a/Mk0.Software.ImageSorter/packages.config +++ b/Mk0.Software.ImageSorter/packages.config @@ -1,8 +1,8 @@  - - - - - + + + + + \ No newline at end of file