Skip to content
Extraits de code Groupes Projets
Valider 26a63499 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

Fix content-type in image upload

parent 219f6556
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/bash
# TODO:
# Scale up, not only down
# Scale up, not only down??
# Fail on remove empty sticker pack dir
# Test trusted source
# Preview
# Thumbnails: https://github.com/matrix-org/synapse/issues/13039 (manually upload small version of the sticker (32x32?) and uses this as thumbnail_url)
# Store hash of source sticker in .stickerpack-hash.json to prevent pack to reupload unchanged stickers (default, can be overriden with flag)
shopt -s nocasematch # Case insensitive
......@@ -277,8 +280,8 @@ STPKG_NO_MSG='no'
STPKG_MAX_HEIGHT=128
STPKG_MAX_WIDTH=256
STPKG_GENERATE_PREVIEW="no"
STPKG_IMAGE_TARGET_FILETYPE="png"
STPKG_ANIMATED_TARGET_FILETYPE="gif"
STPKG_IMAGE_TARGET_FILETYPE="image/png"
STPKG_ANIMATED_TARGET_FILETYPE="image/gif"
__do_mount() { :; }
......@@ -664,7 +667,7 @@ process_sticker_file() {
fi
# TODO: check for gifs here
# TODO: correctly get max width/height for animated
DEST_WIDTH=$(file_get_width "$TEMP")
DEST_HEIGHT=$(file_get_height "$TEMP")
......@@ -910,8 +913,8 @@ __do_command() {
STPKG_MAX_HEIGHT=${STPKG_MAX_HEIGHT:="128"}
STPKG_TRUST_SOURCE=${STPKG_TRUST_SOURCE:="no"}
STPKG_GENERATE_PREVIEW=${STPKG_GENERATE_PREVIEW:="no"}
STPKG_IMAGE_TARGET_FILETYPE=${STPKG_IMAGE_TARGET_FILETYPE:="png"}
STPKG_ANIMATED_TARGET_FILETYPE=${STPKG_ANIMATED_TARGET_FILETYPE:="gif"}
STPKG_IMAGE_TARGET_FILETYPE=${STPKG_IMAGE_TARGET_FILETYPE:="image/png"}
STPKG_ANIMATED_TARGET_FILETYPE=${STPKG_ANIMATED_TARGET_FILETYPE:="image/gif"}
;;&
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter