feat: add support for custom image size file names (#7634)
Add support for custom file names in images sizes
```ts
{
name: 'thumbnail',
width: 400,
height: 300,
generateImageName: ({ height, sizeName, extension, width }) => {
return `custom-${sizeName}-${height}-${width}.${extension}`
},
}
```
This commit is contained in:
@@ -27,6 +27,7 @@ export interface Config {
|
||||
enlarge: Enlarge;
|
||||
reduce: Reduce;
|
||||
'media-trim': MediaTrim;
|
||||
'custom-file-name-media': CustomFileNameMedia;
|
||||
'unstored-media': UnstoredMedia;
|
||||
'externally-served-media': ExternallyServedMedia;
|
||||
'uploads-1': Uploads1;
|
||||
@@ -56,6 +57,7 @@ export interface Config {
|
||||
export interface UserAuthOperations {
|
||||
forgotPassword: {
|
||||
email: string;
|
||||
password: string;
|
||||
};
|
||||
login: {
|
||||
email: string;
|
||||
@@ -67,6 +69,7 @@ export interface UserAuthOperations {
|
||||
};
|
||||
unlock: {
|
||||
email: string;
|
||||
password: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
@@ -754,6 +757,34 @@ export interface MediaTrim {
|
||||
};
|
||||
};
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-file-name-media".
|
||||
*/
|
||||
export interface CustomFileNameMedia {
|
||||
id: string;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
url?: string | null;
|
||||
thumbnailURL?: string | null;
|
||||
filename?: string | null;
|
||||
mimeType?: string | null;
|
||||
filesize?: number | null;
|
||||
width?: number | null;
|
||||
height?: number | null;
|
||||
focalX?: number | null;
|
||||
focalY?: number | null;
|
||||
sizes?: {
|
||||
custom?: {
|
||||
url?: string | null;
|
||||
width?: number | null;
|
||||
height?: number | null;
|
||||
mimeType?: string | null;
|
||||
filesize?: number | null;
|
||||
filename?: string | null;
|
||||
};
|
||||
};
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "unstored-media".
|
||||
|
||||
Reference in New Issue
Block a user