mirror of https://github.com/stashapp/stash.git
Accept gif and webp for images (#2551)
This commit is contained in:
parent
e87fd516d6
commit
20ffd4d51d
|
@ -19,6 +19,10 @@ interface IImageInput {
|
|||
acceptSVG?: boolean;
|
||||
}
|
||||
|
||||
function acceptExtensions(acceptSVG: boolean = false) {
|
||||
return `.jpg,.jpeg,.png,.webp,.gif${acceptSVG ? ",.svg" : ""}`;
|
||||
}
|
||||
|
||||
export const ImageInput: React.FC<IImageInput> = ({
|
||||
isEditing,
|
||||
text,
|
||||
|
@ -42,7 +46,7 @@ export const ImageInput: React.FC<IImageInput> = ({
|
|||
<Form.Control
|
||||
type="file"
|
||||
onChange={onImageChange}
|
||||
accept={`.jpg,.jpeg,.png${acceptSVG ? ",.svg" : ""}`}
|
||||
accept={acceptExtensions(acceptSVG)}
|
||||
/>
|
||||
</Form.Label>
|
||||
);
|
||||
|
@ -102,7 +106,7 @@ export const ImageInput: React.FC<IImageInput> = ({
|
|||
<Form.Control
|
||||
type="file"
|
||||
onChange={onImageChange}
|
||||
accept={`.jpg,.jpeg,.png${acceptSVG ? ",.svg" : ""}`}
|
||||
accept={acceptExtensions(acceptSVG)}
|
||||
/>
|
||||
</Form.Label>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue