mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat: warn when losing transparency during thumbnail generation (#26243)
* feat: preserve alpha * refactor: use isTransparent naming and separate getImageMetadata * warn instead of preserve
This commit is contained in:
@@ -309,9 +309,9 @@ export class MediaRepository {
|
||||
});
|
||||
}
|
||||
|
||||
async getImageDimensions(input: string | Buffer): Promise<ImageDimensions> {
|
||||
const { width = 0, height = 0 } = await sharp(input).metadata();
|
||||
return { width, height };
|
||||
async getImageMetadata(input: string | Buffer): Promise<ImageDimensions & { isTransparent: boolean }> {
|
||||
const { width = 0, height = 0, hasAlpha = false } = await sharp(input).metadata();
|
||||
return { width, height, isTransparent: hasAlpha };
|
||||
}
|
||||
|
||||
private configureFfmpegCall(input: string, output: string | Writable, options: TranscodeCommand) {
|
||||
|
||||
Reference in New Issue
Block a user