p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
13.05k stars 549 forks source link

Integration w/ Clop (Clipboard Optimizer) #851

Closed sanitybit closed 3 months ago

sanitybit commented 3 months ago

Before Submitting Your Feature Request

Problem

I've been a longtime user and big fan of Maccy. Recently, I learned about Clop, which is a tool that will automatically optimize screenshots as soon as they are detected in the clipboard. This usually reduces the screenshot file size by 2/3rd when I paste it into Slack or other sharing tools that send the file without modification.

For example, this screenshot is 1.8mb, but Clop auto-optimized it in my clipboard to 496kb without being written to disk.

image

So far, pretty excellent.

The only downside, and one I haven't found a good workaround for, is that this results in two history items for every copied screenshot, the original copy, and the optimized copy.

image

I've tried adding Clop to the ignore list to see if Maccy won't track the optimized image but still let me paste it, but that doesn't seem to work, and there isn't a specific pasteboard type I can use to ignore it either.

Pasteboard Viewer tells me the source of the optimized image is Clop, but Maccy still seems to think the optimized screenshot came from the source of the unoptimized screenshot (e.g. Firefox).

If there is a change the Clop application can make that could help this work, let me know, and I'll submit a feature request over there.

Solution

When a screenshot or image is copied to the clipboard, and then optimized with Clop, prevent the unoptimized version from being stored in the Maccy history.

p0deje commented 3 months ago

One thing you could do is to add clop.optimisation.status to ignore pasteboard types. This will keep only the original image in the history of Maccy.

Ideally, Clop would provide a way to identify which copied image it changed so Maccy would then replace and original copy with a new one. This is for example how Pure Paste works, see https://github.com/p0deje/Maccy/issues/429#issuecomment-1182575226 for more details. If Clop would provide this extra information. I can add support for it in Maccy.

sanitybit commented 3 months ago

I did try using clop.optimisation.status in the ignored pasteboard types, but that didn't work. Forgot to mention that in my original post since I assumed that just wasn't something that was supported.

Ignoring public.png worked, but that also ignores the original screenshot as well.

In case the above is a bug, I was testing with Maccy 1.0.0.

I will reach out to the Clop devs with the information on Pure Paste's implementation, as I also have some bugs to file with them. Thank you!

p0deje commented 3 months ago

I just tested adding the pasteboard type and it worked perfectly fine. I'm running Maccy 2.0 beta there are no changes related to pasteboard types handing in 2.x.

Screenshot 2024-08-24 at 10 00 31
sanitybit commented 3 months ago

Oh wow, late night PEBCAK. I entered it with a z instead of an s. 😭