サムネイルをJPEGで生成するように (#5941)
This commit is contained in:
@@ -7,7 +7,7 @@ import { deleteFile } from './delete-file';
|
||||
import { fetchMeta } from '../../misc/fetch-meta';
|
||||
import { GenerateVideoThumbnail } from './generate-video-thumbnail';
|
||||
import { driveLogger } from './logger';
|
||||
import { IImage, convertToJpeg, convertToWebp, convertToPng } from './image-processor';
|
||||
import { IImage, convertToJpeg, convertToWebp, convertToPng, convertToPngOrJpeg } from './image-processor';
|
||||
import { contentDisposition } from '../../misc/content-disposition';
|
||||
import { getFileInfo } from '../../misc/get-file-info';
|
||||
import { DriveFiles, DriveFolders, Users, Instances, UserProfiles } from '../../models';
|
||||
@@ -174,7 +174,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
||||
if (['image/jpeg', 'image/webp'].includes(type)) {
|
||||
thumbnail = await convertToJpeg(path, 498, 280);
|
||||
} else if (['image/png'].includes(type)) {
|
||||
thumbnail = await convertToPng(path, 498, 280);
|
||||
thumbnail = await convertToPngOrJpeg(path, 498, 280);
|
||||
} else if (type.startsWith('video/')) {
|
||||
try {
|
||||
thumbnail = await GenerateVideoThumbnail(path);
|
||||
|
||||
Reference in New Issue
Block a user