Copy-Paste Images
Kako da copy-paste radi a da nije PNG
Jebeno pregledaj Projects
Ne radi? https://superuser.com/questions/372602/how-to-copy-picture-from-a-file-to-clipboard
Pronašao sam tool baš za to.
Nakon gledanja koda, ispostavilo se da je to samo jedna jedina linija u kodu.
Clipboard.SetImage(new BitmapImage(new Uri(targetPath.Trim())));
Pa sam zbunjen zašto svi to ne rade nekako?
Autohotkey: OT? Explorer Right-Click Context menu and Explorer++ - AutoHotkey Community I think I worked it out. I need to add #SingleInstance ignore to the top of my script https://www.autohotkey.com/boards/viewtopic.php?t=6981
https://gist.github.com/tmplinshi/6008649 https://www.autohotkey.com/board/topic/122225-how-do-i-copy-an-image-file-as-only-an-image-to-the-clipboard/
Ovaj ima opciju Copy Image Data - Features | ImageGlass
NirCmd Command Reference NirCmd - Freeware command-line tool for Windows
For copyimage and saveimage actions, the following file formats are supported: .bmp, .gif, .jpg, .png, .tiff
nircmdc.exe is the Console Version and it’s the same as nircmd.exe except that in the console version, all error messages goes to the console window, instead of using a message box
CopyQ
Advanced Usage · hluk/CopyQ Wiki
You can simulate Windows Explorer copy command with CopyQ. After download and run CopyQ, type this command:
copyq.exe copy “text/uri-list” “file:///C:/testdir/file.png”
GitHub Gist or comment,
Styling with Markdown is supported
Drag-and-Drop radi normalno
Copy-Paste je uvek u PNG dok je sa Drag-and-Drop može bilo šta.
Problem leži u činjenici da je format u kome je slika zapamćena uvek CF_DIB jer clipboard uses DIB (Device Independent Bitmap") za pamćenje image data. Stoga je i paste uvek u PNG formatu, ma kako i kom formatu je originalni DIB napunjen. See: Standard Clipboard Formats
Za razliku od Copy-Paste, Drag-and-Drop radi u originalnom formatu pošto je drugačiji mehanizam.
Drag-and-Drop in GitHub
Pre svega, u GitHub format slika WebP nije podržan. Podržani su with a GIF, JPEG, JPG, MOV, MP4, PNG, SVG or WEBM. Međutim, ono što možeš da uradiš je da promeniš ekstenziju sa .webp na .gif ili bilo šta drugo, i to će raditi i dalje normalno.
GitHub Comment
U GitHub comments Drag and drop radi normalno pošto je to jedina funkcija
U Gist seAttach files by selecting or pasting them.
JPEG XL is best image format
The Case for JPEG XL Windows JPEG XL support | jpegxl.io ✨ Scoop - Apps (jpeg-xl) jpegxl windows - Google Search
windows - How to copy file path to clipboard? - Super User convert winfoed path to “file://” clipboard format - Google Search Standard Clipboard Formats (Winuser.h) - Win32 apps | Microsoft Learn CF_DIB - Google Search How can I set&get a DIB to/from clipboard? Clipboard Formats - Win32 apps | Microsoft Learn
- windows - How to copy picture from a file to clipboard - Super User
- NirCmd - Freeware command-line tool for Windows
- javascript - Why does Chrome convert the image data to “image/png” mime-type when an image is pasted? - Stack Overflow
- clipboard uses DIB - Google Search
- Introduction: DIBs, DDBs, and the Clipboard | Basic Concepts | Raster Imaging C API Help
- windows - Why can’t I put a DIB section on the clipboard? - Stack Overflow
- Simple Use of the Clipboard
- Introduction: DIBs, DDBs, and the Clipboard | Raster, Medical, Document Help
https://www.google.com/search?client=firefox-b-d&q=windows+explorer+copy+image+content
on sharex
- Actions - ShareX
- sharex convert to avif - Google Search
- Convert images to AVIF/AVIFS with open-source tools | Ivon’s Blog
- Scoop - Apps (magick)
- github copa paste image formats - Google Search
- Actions - ShareX
- Command line arguments - ShareX
- ShareX disable recent task & history – Software RT
EslaMx7/PasteIntoFile: Paste Clipboard Contents Into Files Directly je mali alat sa kojim nešto iz clipboard-a smeštaš u file.
iseahound/ImagePut is an AutoHotkey image library for converting to files, streams, windows, base64, URLs, cursors, screen coordinates, clipboard, pointers, handles, and more, supporting AutoHotkey v1 and v2. You can find documentation-like information in the thread on the AutoHotkey Community website.
Sve završeno sa Screenpresso-m.
C:\Users\Common User\Pictures\Screenpresso\2023-03-29_18h46_45.webp
Screenpresso ume da iskopira u clipboard i file i image. Savršeno. Videćemo kako to radi.
C:\Users\Common User\Pictures\Screenpresso\2023-03-29_18h46_45.webp
Znači, kad uradi u Windows Explorery običan Copy na fajlu, to onda radi na paste u VSCode.
file:///C:/Users/Common User/Pictures/Screenpresso/2023-03-29_18h46_45.webp
U Ditto sam analizirao, vodi ga kao: “CF_HDROP, 158” dok je kad ide kao image, vodi se kao “CF_DIB, 955556”
Radi pravlno samo ako ima CF_HDROP, a ako dodaš CF_DIB, zbuni se VSCode i ne radi. Međutim, Screenpresso “Copy filepath to clipboard” ubacuje i CF_TEXT i CF_UNICODETEXT pored CF_HDROP i to normalno radi.
A postoji i ovaj trick koji nisam znao, pa će verovatno i CopyQ raditi pravilno:
How to reuse file paths copied from a file manager?
Na kraju, kako radi:
- u Screenspresso odabereš “Copy file and filename”, ili samo filename
- u VSCode ideš na “Paste File” - i bez pitanja će da ubaci file