mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
feat(config): ✨ Add option to never convert vector images
This commit is contained in:
parent
6ef3a854d9
commit
de9dca5735
3 changed files with 12 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
* @module MediaManager
|
||||
* @description Handles media conversion between formats
|
||||
*/
|
||||
import { config } from "config-manager";
|
||||
import sharp from "sharp";
|
||||
|
||||
export const supportedMediaFormats = [
|
||||
|
|
@ -33,6 +34,13 @@ export class MediaConverter {
|
|||
* @returns Whether the media is convertable
|
||||
*/
|
||||
public isConvertable(file: File) {
|
||||
if (
|
||||
file.type === "image/svg+xml" &&
|
||||
!config.media.conversion.convert_vector
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return supportedMediaFormats.includes(file.type);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue