• Resolved loxlie

    (@loxlie)


    Hi. Brilliant plugin.
    I have a custom import process that brings in thousands of images, using wp_insert_attachment(). I DO want automatic watermarking on that (which is working great). But I DON’T want auto-watermarking in any other case, including normal uploads to the media library. Is there some kind of filter I can use? I’ve checked the code but can’t see anything obvious. Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Wojtek Sza?kiewicz

    (@szaleq)

    Hi, loxlie,

    There isn’t anything obvious to use in this scenario (yet). But there is a filter which might be useful for you. You can find it in the code here. The idea of this filter was to allow to control which watermark should be applied to which attachment, but you could use it to disable all watermarks in some case and enable it in the other. Here is the example code which could work for you: https://pastebin.com/dFu9Wvxa

    Thread Starter loxlie

    (@loxlie)

    Brilliant. Got that working fine. (And great idea exposing the post fields in a magic getter – it meant I could use a back-end ACF post field to allow the client to select the watermark post to use for the importer, and then check in the filter so other watermarks aren’t affected.)
    Just to clarify for others, the auto-watermark setting stays on, (or the filter is never hit) and the filter checks the context to potentially turn it off.
    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Watermarking in an automated process’ is closed to new replies.