Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recognizing images that are processed via Clop #84

Open
ylluminate opened this issue Oct 2, 2024 · 4 comments
Open

Not recognizing images that are processed via Clop #84

ylluminate opened this issue Oct 2, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ylluminate
Copy link

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):

  • OS: macOS 15.1b5
@onmyway133
Copy link
Member

@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
Copy link
Author

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
Copy link

alin23 commented Oct 3, 2024

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
Copy link
Member

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

@onmyway133 onmyway133 added the enhancement New feature or request label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants