Skip to content

Fix Failure when uploading clipboard images with PicGo (#3360) - #3366

Closed
Jakentop wants to merge 1 commit into
marktext:developfrom
Jakentop:develop
Closed

Jakentop wants to merge 1 commit into
marktext:developfrom
Jakentop:develop

Conversation

@Jakentop

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
Breaking changes? no
Deprecations? no
New tests added? not needed
Fixed tickets Fixes #3360
License MIT

Description

Fix the situation that picgo uploading pictures from clipboard will keep spinning around and cannot upload successfully.
The reason for the error is that the clipboard image needs to be saved in a temporary file when uploading, but when calling string splicing, it tries to splice a number type into a string resulting in an error.
Even if the number is converted to a string type, when picgo uploads it does not recognize the MIME-Type due to the lack of a suffix, so picgo throws an exception.
A more complete solution is to get the MIME-TYPE of the image and convert it to the corresponding suffix. But here the fix directly adds a default suffix .png to the image, and after testing I found this to be the easiest and working solution.

@Jocs
Jocs requested a review from Chance-Y112 November 18, 2025 14:06
@Jocs

Jocs commented May 11, 2026

Copy link
Copy Markdown
Member

pls resolve the confilits

@Jocs

Jocs commented May 11, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

@Jocs

Jocs commented May 15, 2026

Copy link
Copy Markdown
Member

This project recently merged a large refactor (electron-vite migration, PR #4001) that upgraded dependencies and fixed several issues.

Please review this PR and let us know if it is still needed, or if the changes have already been addressed upstream.

Note: This PR currently has merge conflicts with the develop branch. If you decide to continue with this PR, please rebase or merge the latest develop branch to resolve the conflicts before it can be reviewed.

@Jocs

Jocs commented May 20, 2026

Copy link
Copy Markdown
Member

Thank you for the contribution. Since this PR was opened, the project has gone through a significant refactor to electron-vite (#4001) — src/renderer/util/fileSystem.js is now src/renderer/src/util/fileSystem.js, and the upload/clipboard code path has been reworked. The one-line fix here can no longer be applied to develop.

Closing this PR so it doesn't get stuck in limbo. If the PicGo clipboard-upload issue (#3360) still reproduces on the current develop branch, please feel free to open a new PR on top of the latest code — we'd be happy to review it.

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

Successfully merging this pull request may close these issues.

Failure when uploading clipboard images with PicGo

3 participants