IndieGoodies / PastePal

PastePal is the best universal clipboard manager for Mac, iPhone and iPad.
https://onmyway133.com/pastepal/
112 stars 4 forks source link

Not recognizing images that are processed via Clop #84

Open ylluminate opened 1 month ago

ylluminate commented 1 month ago

Describe the bug If Clop (https://github.com/FuzzyIdeas/Clop) is off, PastePal will ingest the image, but if Clop is on/active PastePal does not seem to ingest the image(s).

To Reproduce Steps to reproduce the behavior:

  1. Star Clop
  2. Capture a screenshot that Clop processes (command-shift-4 to grab a region for me)
  3. See that Clop processes it, but content does not end up in PastePal.

Expected behavior Any image either optimized via Clop or otherwise should end up in PastePal, just as it does for PasteBot - for example.

Desktop (please complete the following information):

onmyway133 commented 1 month ago

@ylluminate Hi, thanks for the feedback.

Before PastePal didn't ignore apps like Clop by default, which resulted in unwanted modified data registered in PastePal. In recent versions of PastePal, we started to ignore Clop, so that's the behavior you're seeing. I may need to check which is best handled in this case

ylluminate commented 1 month ago

Thanks for that explanation and consideration! I will say while I am alright with PasteBot's behavior, I would like to see a mechanism that would facilitate non-duplication. When PasteBot receives the optimized paste it does so in a kind of duplicated fashion, but this "works" (better than not at all, for example). If you can figure out an optimal mechanism for this scenario, that would be truly amazing. Thank you.

alin23 commented 1 month ago

Most clipboard history apps, like Raycast and Alfred for example, show both the initial image and the optimised one (as that's the way it appears in the macOS pasteboard, since apps can't modify the clipboard, only append to it)

CleanShot-006655-Thursday-10-05_42e3db10d070cb59b742107d09d705f2f71be564a8759e4906d3ec4534012e93

It might be a good idea to do the same as the default, and maybe provide a setting that would detect Clop's optimised image and replace the initial image with it.

Detecting images copied by Clop is easy by looking at the clop.optimisation.status item:

extension NSPasteboard.PasteboardType {
    static var optimisationStatus: NSPasteboard.PasteboardType = .init("clop.optimisation.status")
}

if let item = NSPasteboard.general.pasteboardItems?.first, item.string(forType: .optimisationStatus) == "true" else {
    // do your thang
}

Clipboard Viewer-006657-Thursday-10-08

Before PastePal didn't ignore apps like Clop by default, which resulted in unwanted modified data registered in PastePal

If you have trouble with how Clop adds to clipboard let me know, maybe I can do something to help clipboard apps more.

onmyway133 commented 1 month ago

@alin23 Thanks for the suggestion, I will take a look