diff --git a/Marechai/Helpers/Exif.cs b/Marechai/Helpers/Exif.cs index 04c357d7..8f742b13 100644 --- a/Marechai/Helpers/Exif.cs +++ b/Marechai/Helpers/Exif.cs @@ -109,6 +109,21 @@ namespace Marechai.Helpers model.WhiteBalance = WhiteBalance; model.Comments = Description; } + + public void ToViewModel(BaseScanViewModel model) + { + model.ScannerManufacturer = Make; + model.ScannerModel = Model; + model.Author = Author; + model.CreationDate = DateTimeOriginal ?? CreateDate ?? ModifyDate; + model.ExifVersion = ExifVersion; + model.HorizontalResolution = XResolution; + model.SoftwareUsed = Software; + model.VerticalResolution = YResolution; + model.ColorSpace = ColorSpace; + model.ResolutionUnit = ResolutionUnit; + model.Comments = Description; + } } internal class ExiftoolDateConverter : JsonConverter diff --git a/Marechai/ViewModels/BaseScanViewModel.cs b/Marechai/ViewModels/BaseScanViewModel.cs new file mode 100644 index 00000000..68ca1610 --- /dev/null +++ b/Marechai/ViewModels/BaseScanViewModel.cs @@ -0,0 +1,48 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using System; +using Marechai.Database; + +namespace Marechai.ViewModels +{ + public class BaseScanViewModel : BaseViewModel + { + public string Author { get; set; } + public ColorSpace? ColorSpace { get; set; } + public string Comments { get; set; } + public DateTime? CreationDate { get; set; } + public string ExifVersion { get; set; } + public double? HorizontalResolution { get; set; } + public ResolutionUnit? ResolutionUnit { get; set; } + public string ScannerManufacturer { get; set; } + public string ScannerModel { get; set; } + public string SoftwareUsed { get; set; } + public DateTime UploadDate { get; set; } + public double? VerticalResolution { get; set; } + public string OriginalExtension { get; set; } + public string UserId { get; set; } + } +} \ No newline at end of file diff --git a/Marechai/ViewModels/DocumentScanBaseViewModel.cs b/Marechai/ViewModels/DocumentScanBaseViewModel.cs new file mode 100644 index 00000000..52238776 --- /dev/null +++ b/Marechai/ViewModels/DocumentScanBaseViewModel.cs @@ -0,0 +1,35 @@ +/****************************************************************************** +// MARECHAI: Master repository of computing history artifacts information +// ---------------------------------------------------------------------------- +// +// Author(s) : Natalia Portillo +// +// --[ License ] -------------------------------------------------------------- +// +// 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2003-2020 Natalia Portillo +*******************************************************************************/ + +using Marechai.Database; + +namespace Marechai.ViewModels +{ + public class DocumentScanBaseViewModel : BaseScanViewModel + { + public DocumentScanType Type { get; set; } + public uint? Page { get; set; } + } +} \ No newline at end of file