mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
chore: pr feedback
This commit is contained in:
parent
9cd0871178
commit
6a4f48204d
@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { BinaryField, DefaultReadTaskOptions, ExifTool, Tags } from 'exiftool-vendored';
|
import { BinaryField, DefaultReadTaskOptions, ExifTool, Tags } from 'exiftool-vendored';
|
||||||
import geotz from 'geo-tz';
|
import geotz from 'geo-tz';
|
||||||
|
import { LogLevel } from 'src/enum';
|
||||||
import { LoggingRepository } from 'src/repositories/logging.repository';
|
import { LoggingRepository } from 'src/repositories/logging.repository';
|
||||||
|
|
||||||
interface ExifDuration {
|
interface ExifDuration {
|
||||||
@ -101,7 +102,9 @@ export class MetadataRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async writeTags(path: string, tags: Partial<Tags>): Promise<void> {
|
async writeTags(path: string, tags: Partial<Tags>): Promise<void> {
|
||||||
this.logger.verbose(`Writing tags ${JSON.stringify(tags)} to ${path}`);
|
if (this.logger.isLevelEnabled(LogLevel.VERBOSE)) {
|
||||||
|
this.logger.verbose(`Writing tags ${JSON.stringify(tags)} to ${path}`);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
await this.exiftool.write(path, tags);
|
await this.exiftool.write(path, tags);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -60,8 +60,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRotate = async () => {
|
const handleRotate = async () => {
|
||||||
const current = Number(asset.exifInfo?.orientation);
|
if (!asset.exifInfo?.orientation) {
|
||||||
if (!current && current !== 0) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const current = Number(asset.exifInfo.orientation);
|
||||||
|
if (Number.isNaN(current)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user