allow image/gif

This commit is contained in:
zapashcanon 2022-04-06 01:28:15 +02:00
parent 1f8e4873a1
commit ac64d93635
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
3 changed files with 2 additions and 2 deletions

View file

@ -41,7 +41,7 @@ let f request =
<input name="tags" type="text" class="form-control" id="tags" aria-labelledby="tags-label" /> <input name="tags" type="text" class="form-control" id="tags" aria-labelledby="tags-label" />
<br /> <br />
<label for="file" id="file-label" class="form-label">Picture:</label> <label for="file" id="file-label" class="form-label">Picture:</label>
<input id="file" name="file" aria-describedby="file-label" type="file" accept="image/png,image/jpeg,image/webp"> <input id="file" name="file" aria-describedby="file-label" type="file" accept="image/png,image/jpeg,image/webp,image/gif">
<br /> <br />
<label for="alt" id="alt-label" class="form-label">Image description:</label> <label for="alt" id="alt-label" class="form-label">Image description:</label>
<input name="alt" type="text" class="form-control" id="alt" aria-labelledby="alt-label" /> <input name="alt" type="text" class="form-control" id="alt" aria-labelledby="alt-label" />

View file

@ -180,7 +180,7 @@ let make_image image =
| None -> Error "invalid image type" | None -> Error "invalid image type"
| Some mime -> ( | Some mime -> (
match mime with match mime with
| "image/jpeg" | "image/png" | "image/webp" -> ( | "image/jpeg" | "image/png" | "image/webp" | "image/gif" -> (
match make_thumbnail content with match make_thumbnail content with
| Error e -> Error e | Error e -> Error e
| Ok thumbnail -> Ok { name; alt; content; thumbnail } ) | Ok thumbnail -> Ok { name; alt; content; thumbnail } )