Get image from clipboard and save it to an image file(jpg/png) by using php.
PHP-GetImgFromClipboard is a tool that allows you to get image on the clipboard(usually copy to the clipboard by taking a screenshot or copy from web page) and save it to an image file like jpg or png.
composer require xiebruce/php-get-image-from-clipboardActually, php can not get image on the clipboard directly, so this tool is rely on other tools.
For macOS, it relies on pngpaste, so you should install pngpaste first:
brew install pngpaste
For Windows 10, it's free to use, nothing need to be install.
For Windows 7, you need to update Powershell. Download Powershell update package "Win7AndW2K8R2-KB3191566-x64.zip" from here: https://www.microsoft.com/en-us/download/details.aspx?id=54616, then update and restart.
Before update, you can check the Powershell version. Click "Start" menu on the bottom right corner, input "powershell" to search, then powershell shows up like this:
Click to open it and type this command:
$PSVersionTable
Now you can see, before update, the Powershell version is 2.0:
After update, the Powershell version is 5.0:
For Linux Desktop System(e.g. Ubuntu, Manjaro, CentOS etc.) , you need to install xclip.
On Ubuntu:
apt install xclipI didn't test other Linux distributions, but it should be work as long as you install xclip.
from https://github.com/xiebruce/php-get-image-from-clipboard



