mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
🎨 Browser clipping extension supports clipping SVG https://github.com/siyuan-note/siyuan/issues/14523
This commit is contained in:
parent
a01523dc98
commit
80fbe14281
1 changed files with 4 additions and 0 deletions
|
|
@ -1144,6 +1144,8 @@ func processBase64Img(n *ast.Node, dest string, assetDirPath string) {
|
|||
case "image/jpeg":
|
||||
img, decodeErr = jpeg.Decode(dataReader)
|
||||
ext = ".jpg"
|
||||
case "image/svg+xml":
|
||||
ext = ".svg"
|
||||
default:
|
||||
logging.LogWarnf("unsupported base64 image type [%s]", typ)
|
||||
return
|
||||
|
|
@ -1174,6 +1176,8 @@ func processBase64Img(n *ast.Node, dest string, assetDirPath string) {
|
|||
encodeErr = png.Encode(tmpFile, img)
|
||||
case "image/jpeg":
|
||||
encodeErr = jpeg.Encode(tmpFile, img, &jpeg.Options{Quality: 100})
|
||||
case "image/svg+xml":
|
||||
_, encodeErr = tmpFile.Write(unbased)
|
||||
}
|
||||
if nil != encodeErr {
|
||||
logging.LogErrorf("encode base64 image failed: %s", encodeErr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue