-
-
Notifications
You must be signed in to change notification settings - Fork 697
Expand file tree
/
Copy pathIgMetadata.cs
More file actions
85 lines (69 loc) · 3.22 KB
/
IgMetadata.cs
File metadata and controls
85 lines (69 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
ImageGlass Project - Image viewer for Windows
Copyright (C) 2010 - 2026 DUONG DIEU PHAP
Project homepage: https://imageglass.org
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace ImageGlass.Base.Photoing.Codecs;
public class IgMetadata
{
// File metadata
public string FilePath { get; set; } = string.Empty;
public string FileName { get; set; } = string.Empty;
public string FileExtension { get; set; } = string.Empty;
public string FolderPath { get; set; } = string.Empty;
public string FolderName { get; set; } = string.Empty;
public DateTime FileCreationTime { get; set; } // local time
public DateTime FileLastAccessTime { get; set; } // local time
public DateTime FileLastWriteTime { get; set; } // local time
public string FileCreationTimeFormated => BHelper.FormatDateTime(FileCreationTime);
public string FileLastAccessTimeFormated => BHelper.FormatDateTime(FileLastAccessTime);
public string FileLastWriteTimeFormated => BHelper.FormatDateTime(FileLastWriteTime);
/// <summary>
/// File size in bytes.
/// </summary>
public long FileSize { get; set; } = 0;
/// <summary>
/// The formated file size. E.g. <c>32.09 MB</c>.
/// </summary>
public string FileSizeFormated => BHelper.FormatSize(FileSize);
// Image data
public uint OriginalWidth { get; set; } = 0;
public uint OriginalHeight { get; set; } = 0;
public uint RenderedWidth { get; set; } = 0;
public uint RenderedHeight { get; set; } = 0;
// DPI
public float DpiX { get; set; } = 0;
public float DpiY { get; set; } = 0;
/// <summary>
/// Gets the frame index of this metadata.
/// </summary>
public uint FrameIndex { get; set; } = 0;
public int FrameCount { get; set; } = 0;
public bool HasAlpha { get; set; } = false;
public bool CanAnimate { get; set; } = false;
public string ColorSpace { get; set; } = string.Empty;
public string ColorProfile { get; set; } = string.Empty;
// EXIF metadata
public int ExifRatingPercent { get; set; } = 0;
public DateTime? ExifDateTimeOriginal { get; set; } = null; // local time
public DateTime? ExifDateTime { get; set; } = null; // local time
public string? ExifImageDescription { get; set; } = null;
public string? ExifModel { get; set; } = null;
public string? ExifArtist { get; set; } = null;
public string? ExifCopyright { get; set; } = null;
public string? ExifSoftware { get; set; } = null;
public float? ExifExposureTime { get; set; } = null;
public float? ExifFNumber { get; set; } = null;
public int? ExifISOSpeed { get; set; } = null;
public float? ExifFocalLength { get; set; } = null;
}