update at 2025-10-08 09:18:20

This commit is contained in:
douboer
2025-10-08 09:18:20 +08:00
parent a49e389fe2
commit 584d4151fc
67 changed files with 5363 additions and 892 deletions

View File

@@ -1,24 +1,4 @@
/*
* Copyright (c) 2024-2025 Sun Booshi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/* 文件markdown/local-file.ts — 本地图片文件管理与路径解析器。 */
import { Token, Tokens, MarkedExtension } from "marked";
import { Notice, TAbstractFile, TFile, Vault, MarkdownView, requestUrl, Platform } from "obsidian";
@@ -110,7 +90,10 @@ export class LocalImageManager {
if (this.isWebp(file)) {
if (IsImageLibReady()) {
fileData = WebpToJPG(fileData);
{
const jpgUint8 = WebpToJPG(fileData);
fileData = jpgUint8.buffer as ArrayBuffer;
}
name = name.toLowerCase().replace('.webp', '.jpg');
}
else {
@@ -236,7 +219,10 @@ export class LocalImageManager {
if (this.isWebp(filename)) {
if (IsImageLibReady()) {
data = WebpToJPG(data);
{
const jpgUint8 = WebpToJPG(data);
data = jpgUint8.buffer as ArrayBuffer;
}
blob = new Blob([data]);
filename = filename.toLowerCase().replace('.webp', '.jpg');
}