nintendo switch

vscode Paste Image Automatically Uploads to Doge Image Hosting (New)

About three weeks ago, I wrote an article documenting the method of automatically uploading pasted images to Dogedoge Image Hosting using VSCode. However, during my usage in the past few weeks, I gradually discovered its limitations: it seems that due to access restrictions, this extension can only upload temporary photos from the clipboard and cannot properly upload locally copied photos. The specific issue is that the uploaded image is empty.

This prompted me to try other methods and ultimately decide to switch to vs-picgo.

Using the vs-picgo Extension#

In the first article, I also mentioned that the file of vs-picgo states that it only supports the eight image hosting services officially supported by picgo-core, and the plugin system is still a work in progress:

vs-picgo supports 8 kinds of image hosting services: weibo, qiniu, tcyun, upyun, github, aliyun, imgur and SM.MS, which are supported by PicGo-Core. And the plugin feature of PicGo-Core is working in progress.

It was because of this statement that I gave up on trying it out and went through the exploration process after the first article. However, after manually installing and trying it out this time, I found that I may have misunderstood the developer's intention.

Upon careful examination of the vs-picgo settings, I discovered a configuration option called "Config path," with the following description: The path to your Picgo-Core configuration. Picgo will use Picgo: Pic Bed if this is not specified. In other words, we can already override the settings of this extension by specifying the location of the Picgo Core configuration file, and thus use third-party plugins of Picgo Core. The unfinished aspect of vs-picgo may only refer to the graphical configuration of the plugin system...

Since that's the case, the goal is clear. We just need to install Picgo Core and configure it accordingly, and finally specify the configuration file path in the extension.

Installing Picgo Core#

Refer to the For global installation, simply run:

yarn global add picgo
# or
npm install picgo -g

Configuring Picgo Core#

In order to upload to Dogedoge Image Hosting, we need to install the web-uploader plugin and configure it.

picgo install web-uploader
picgo config uploader

? Choose a(n) uploader # Select web-uploader
? API address # Enter your upload address
? POST parameter name # file
? Image URL JSON path (eg: data.url) # data.o_url
? Custom request headers Standard JSON (eg: {"key":"value"}) # Leave blank
? Custom body Standard JSON (eg: {"key":"value"}) # Leave blank

picgo use uploader

? Use an uploader # Select web-uploader

After configuring, you can test if the upload works properly by running picgo upload /path/to/an/image. If the upload is successful, it means the configuration is correct.

Configuring vs-picgo#

The final step is to specify the configuration file of picgo core in the vs-picgo settings. Refer to the official documentation:

The default configuration file for picgo is ~/.picgo/config.json. The ~ represents the user directory. The user directories are different on different systems.

For Linux and macOS, it is ~/.picgo/config.json.

For Windows, it is C:\Users\YourUsername.picgo\config.json.

For example, the configuration on GNU/Linux:


Using vs-picgo#

Finally, let's talk about how to use it. The default shortcuts are as follows:

OSUploading an image from clipboardUploading images from explorerUploading an image from input box
Windows/UnixCtrl + Alt + UCtrl + Alt + ECtrl + Alt + O
Os XCmd + Opt + UCmd + Opt + ECmd + Opt + O
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.