"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExifResponseDto = void 0;
exports.mapExif = mapExif;
exports.mapSanitizedExif = mapSanitizedExif;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const date_1 = require("../utils/date");
class ExifResponseDto {
    make = null;
    model = null;
    exifImageWidth = null;
    exifImageHeight = null;
    fileSizeInByte = null;
    orientation = null;
    dateTimeOriginal = null;
    modifyDate = null;
    timeZone = null;
    lensModel = null;
    fNumber = null;
    focalLength = null;
    iso = null;
    exposureTime = null;
    latitude = null;
    longitude = null;
    city = null;
    state = null;
    country = null;
    description = null;
    projectionType = null;
    rating = null;
    static _OPENAPI_METADATA_FACTORY() {
        return { make: { required: false, type: () => String, nullable: true, default: null }, model: { required: false, type: () => String, nullable: true, default: null }, exifImageWidth: { required: false, type: () => Number, nullable: true, default: null }, exifImageHeight: { required: false, type: () => Number, nullable: true, default: null }, fileSizeInByte: { required: false, type: () => Number, nullable: true, default: null }, orientation: { required: false, type: () => String, nullable: true, default: null }, dateTimeOriginal: { required: false, type: () => String, nullable: true, default: null }, modifyDate: { required: false, type: () => String, nullable: true, default: null }, timeZone: { required: false, type: () => String, nullable: true, default: null }, lensModel: { required: false, type: () => String, nullable: true, default: null }, fNumber: { required: false, type: () => Number, nullable: true, default: null }, focalLength: { required: false, type: () => Number, nullable: true, default: null }, iso: { required: false, type: () => Number, nullable: true, default: null }, exposureTime: { required: false, type: () => String, nullable: true, default: null }, latitude: { required: false, type: () => Number, nullable: true, default: null }, longitude: { required: false, type: () => Number, nullable: true, default: null }, city: { required: false, type: () => String, nullable: true, default: null }, state: { required: false, type: () => String, nullable: true, default: null }, country: { required: false, type: () => String, nullable: true, default: null }, description: { required: false, type: () => String, nullable: true, default: null }, projectionType: { required: false, type: () => String, nullable: true, default: null }, rating: { required: false, type: () => Number, nullable: true, default: null } };
    }
}
exports.ExifResponseDto = ExifResponseDto;
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Camera make' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "make", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Camera model' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "model", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'Image width in pixels' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "exifImageWidth", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'Image height in pixels' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "exifImageHeight", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ type: 'integer', format: 'int64', description: 'File size in bytes' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "fileSizeInByte", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Image orientation' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "orientation", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Original date/time', format: 'date-time' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "dateTimeOriginal", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Modification date/time', format: 'date-time' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "modifyDate", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Time zone' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "timeZone", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Lens model' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "lensModel", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'F-number (aperture)' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "fNumber", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'Focal length in mm' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "focalLength", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'ISO sensitivity' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "iso", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Exposure time' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "exposureTime", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'GPS latitude' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "latitude", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'GPS longitude' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "longitude", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'City name' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "city", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'State/province name' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "state", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Country name' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "country", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Image description' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "description", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Projection type' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "projectionType", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ type: 'number', description: 'Rating' }),
    __metadata("design:type", Object)
], ExifResponseDto.prototype, "rating", void 0);
function mapExif(entity) {
    return {
        make: entity.make,
        model: entity.model,
        exifImageWidth: entity.exifImageWidth,
        exifImageHeight: entity.exifImageHeight,
        fileSizeInByte: entity.fileSizeInByte ? Number.parseInt(entity.fileSizeInByte.toString()) : null,
        orientation: entity.orientation,
        dateTimeOriginal: (0, date_1.asDateString)(entity.dateTimeOriginal),
        modifyDate: (0, date_1.asDateString)(entity.modifyDate),
        timeZone: entity.timeZone,
        lensModel: entity.lensModel,
        fNumber: entity.fNumber,
        focalLength: entity.focalLength,
        iso: entity.iso,
        exposureTime: entity.exposureTime,
        latitude: entity.latitude,
        longitude: entity.longitude,
        city: entity.city,
        state: entity.state,
        country: entity.country,
        description: entity.description,
        projectionType: entity.projectionType,
        rating: entity.rating,
    };
}
function mapSanitizedExif(entity) {
    return {
        fileSizeInByte: entity.fileSizeInByte ? Number.parseInt(entity.fileSizeInByte.toString()) : null,
        orientation: entity.orientation,
        dateTimeOriginal: (0, date_1.asDateString)(entity.dateTimeOriginal),
        timeZone: entity.timeZone,
        projectionType: entity.projectionType,
        exifImageWidth: entity.exifImageWidth,
        exifImageHeight: entity.exifImageHeight,
        rating: entity.rating,
    };
}
//# sourceMappingURL=exif.dto.js.map