diff --git a/docker-compose.yml b/docker-compose.yml index ea8351575..daef8b436 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,10 @@ services: depends_on: - redis - postgres + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse redis: container_name: "redis" diff --git a/files/helpers/media.py b/files/helpers/media.py index 5e68cbd1e..464064326 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -140,7 +140,9 @@ def process_image(filename:str, v, resize=0, trim=False, uploader_id:Optional[in try: with Image.open(filename) as i: - params = ["convert", "-coalesce", filename, "-quality", "88", "-define", "webp:method=5", "-strip", "-auto-orient"] + params = ["./magick", filename, "-strip", "-auto-orient"] + if i.format.lower() != 'webp': + params.extend(["-coalesce", "-quality", "88", "-define", "webp:method=5"]) if trim and len(list(Iterator(i))) == 1: params.append("-trim") if resize and i.width > resize: diff --git a/magick b/magick new file mode 100644 index 000000000..75279eb6b Binary files /dev/null and b/magick differ diff --git a/ubuntu_setup.sh b/ubuntu_setup.sh index e45a263df..575e6d020 100644 --- a/ubuntu_setup.sh +++ b/ubuntu_setup.sh @@ -1,6 +1,6 @@ apt -y update apt -y upgrade -apt -y install git redis-server python3-pip ffmpeg imagemagick tmux nginx snapd ufw gpg-agent htop nano +apt -y install git redis-server python3-pip ffmpeg tmux nginx snapd ufw gpg-agent htop nano git config --global credential.helper store cd /rDrama