NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.06k stars 13.39k forks source link

Pleroma mogrify upload filter doesn't work together with other filters #261779

Open Elinvention opened 10 months ago

Elinvention commented 10 months ago

Describe the bug

I enabled Mogrify filter together with Dedupe and AnonymizeFilename. If I upload an image, the mogrify filter is ignored and the full resolution image is published.

If I disable all other filters and leave only Mogrify anabled, then it works correctly, as expected.

I couldn't find anything useful in the logs.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable [ Pleroma.Upload.Filter.Dedupe, Pleroma.Upload.Filter.AnonymizeFilename, Pleroma.Upload.Filter.Mogrify ] in that order.
  2. Set some mogrify arguments like: {"format", "jpg"}, {"define", "jpeg:extent=128kb"}
  3. upload a big image
  4. the image is not processed by mogrify and is still big

Expected behavior

I would like to enable Dedupe, AnonymizeFilename and Mogrify together as normal.

Screenshots

Part of my config:

config :pleroma, Pleroma.Upload,
  uploader: Pleroma.Uploaders.Local,
  filters: [
    Pleroma.Upload.Filter.Dedupe,
    Pleroma.Upload.Filter.AnonymizeFilename,
    Pleroma.Upload.Filter.Mogrify
  ],
  link_name: true

config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads/"

config :pleroma, Pleroma.Upload.Filter.Mogrify,
  args: [
    "strip",
    "auto-orient",
    {"format", "jpg"},
    {"resize", "2073600@>"},
    {"define", "jpeg:extent=512kb"}
  ]

Notify maintainers

@NinjaTrappeur @yu-re-ka @Kloenk @yayayayaka

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.57-hardened1, NixOS, 23.05 (Stoat), 23.05.4362.6f87c4d764f4`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - channels(root): `"nixos-23.05-small, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
picnoir commented 10 months ago

Do you think this bug is related to the NixOS pleroma integration? If so, could you point out the specifics that makes you think it is the case?

Elinvention commented 10 months ago

I think the problem is in NixOS because this kind of config was working for me before I moved to NixOS and I know it works with other people's setup without NixOS. Specifically, I don't know what could lead to this strange behavior.