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

How to show thumbnail preview #805

Open
zvit opened this issue Feb 21, 2025 · 8 comments
Open

How to show thumbnail preview #805

zvit opened this issue Feb 21, 2025 · 8 comments

Comments

@zvit
Copy link

zvit commented Feb 21, 2025

I've seen posts from 2013 mentioning that thumbnails were displayed for copied images, but when I copied a PNG, it only shows the file path. How can I view a thumbnail of the copied image in Ditto?

@sabrogden
Copy link
Owner

You need to copy something that places cf_dib or png onto the clipboard. Take a screen shot or select and area in paint or any image editor and copy it. From there it will show a thumbnail of the image, press F3 to see it bigger.

@zvit
Copy link
Author

zvit commented Feb 21, 2025

That's what I did and what I meant when I said I copied a PNG. As you can see in the screenshot, only the image path is visible to me. I can paste the image itself, but I’m not seeing a thumbnail.

Image

@sabrogden
Copy link
Owner

However you are copying the png it's putting a copied file on the clipboard as a CF_HDROP (copied file). If you press alt-enter to open the clip properties you should see CF_HDROP, you want to see CF_DIB or PNG for a copied image. Try copying a selection in paint.

Image

@zvit
Copy link
Author

zvit commented Feb 21, 2025

Yes, copying selections in Paint register as CF_DIB, and display a thumbnail. However, most clipboard images come from screenshots or file copies rather than manual selections. Other clipboard managers show thumbnails for all image sources. Any reason Ditto doesn't?

@deepdvd
Copy link

deepdvd commented Feb 21, 2025

For what it's worth, I wouldn't want this "feature" ^ to show a thumbnail of the image source. I wouldn't want Ditto to try to preview PDFs or other documents either that I simply copied the path of the file for.

Copying a file isn't the same as copying an actual image. When you copy an image, it puts that actual image into the clipboard, not the path of the file to copy.

@sabrogden
Copy link
Owner

No plans to show file previews. Check how you are doing screen shots, windows snipping tool does does not do files and places cf_dib and png on the clipboard.

@zvit
Copy link
Author

zvit commented Feb 21, 2025

@deepdvd I’m not referring to situations where I copied a file path. I mean actually copying a PNG file to the clipboard for pasting elsewhere. I’d love for Ditto to show a thumbnail of copied images, so I can preview them and know what they look like before pasting. Just seeing a filename like "window_screenshot_20250221_131017" doesn’t tell me anything about the image’s content.

@sabrogden I used to use ShareX with a setting that copies the screenshot to the clipboard right after capturing it, allowing me to paste it somewhere else. I haven't tested Ditto with ShareX. I now use a custom Python script for taking screenshots, triggered by a gaming mouse button. Once the screenshot is taken, it executes a .bat file to copy the image to the clipboard.

@echo off
set "img_path=%~1"
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -command ^
"Add-Type -AssemblyName System.Windows.Forms; ^
 Add-Type -AssemblyName System.IO; ^
 $file = Get-Item -Path '%img_path%'; ^
 [System.Windows.Forms.Clipboard]::SetFileDropList(([System.Collections.Specialized.StringCollection]($file.FullName))); ^
 Write-Output 'Image successfully copied to clipboard' "

@deepdvd
Copy link

deepdvd commented Feb 24, 2025

@zvit Yeah, I'm aware of what you mean, and I think it's a bad idea. You're copying a file or list of files. Just use your file explorer preview instead of adding bloat to Ditto. It only makes sense to show the image if you can't preview it in the file system, since it's only in the clipboard / ditto database.

What about when you copy 2 files, or 3 files, or some images along with other files? Are you hoping it would show all those images too?

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants