Skip to content

Commit

Permalink
[fix] bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hbl917070 committed Dec 22, 2023
1 parent 1154ebf commit de5c165
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
11 changes: 6 additions & 5 deletions Www/scss/MainWindow/_MainExif.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
display: flex;
align-items: center;

// 上面的頁籤按鈕
.mainExifTabs {
flex: 1;
width: 100%;
// height: 33px;
// margin-bottom: -3px;
height: 33px;
margin-bottom: -3px;
overflow-x: visible;
overflow-y: hidden;
position: relative;
display: none;
//border-bottom: 1px solid var(--color-blue20);


// 頁籤按鈕下面的水平線
&::before {
content: "";
position: absolute;
Expand Down Expand Up @@ -100,7 +101,7 @@
}
}

//相關檔案
// 相關檔案
.mainExifRelated {
padding: 0 5px;
margin-top: 5px;
Expand Down
9 changes: 7 additions & 2 deletions Www/ts/MainWindow/MainExif.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class MainExif {
}
else if (name === "Comment" || name === "User Comment" || name === "Windows XP Comment" || name === "Image Description") {

// Stable Diffusion webui 輸出的jpg或webp
// Stable Diffusion webui 輸出的 jpg 或 webp
if (value.includes("Steps: ") && value.includes("Seed: ")) {
ar.push({
group: "PNG-tEXt",
Expand All @@ -329,7 +329,7 @@ class MainExif {
let jsonF = Lib.jsonStrFormat(value);
if (jsonF.ok) { // 解析欄位
if (value.startsWith(`{"prompt":`)) { // ComfyUI
comfyuiPrompt = (JSON.parse(value)["prompt"]);
comfyuiPrompt = JSON.parse(value)["prompt"];
}
}
}
Expand Down Expand Up @@ -460,6 +460,11 @@ class MainExif {
let collapseDom = getCollapseDom("ComfyUI Data", false);

if (comfyuiPrompt !== undefined) {
if (typeof comfyuiPrompt === "object") { // 從 mp4 提取出來的 Prompt 是 json,所以要轉回 string
try {
comfyuiPrompt = JSON.stringify(comfyuiPrompt);
} catch { }
}
collapseDom.domContent.appendChild(getItemDom("Prompt", comfyuiPrompt));
}
if (comfyuiWorkflow !== undefined) {
Expand Down
11 changes: 3 additions & 8 deletions Www/ts/MainWindow/MainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,9 @@ class MainWindow {
}

} else {
let arFile = [];
for (let i = 0; i < args.length; i++) {
arFile.push(Lib.GetFileName(args[i]));
}
let dirPath = Lib.GetDirectoryName(args[0]);
if (dirPath !== null) {
await fileLoad.loadFiles(dirPath, arFile); // 載入多張圖片
}

await fileLoad.loadFiles(args); // 載入多張圖片

}

// 在圖片載入完成後,更新「用其他APP開啟檔案」的列表
Expand Down
20 changes: 12 additions & 8 deletions Www/ts/MainWindow/Script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1075,14 +1075,8 @@ class ScriptOpen {
if (arFile.length === 1) {
this.M.fileLoad.loadFile(arFile[0]);
}
if (arFile.length > 1) {
let arName = [];
for (let i = 0; i < arFile.length; i++) {
arName.push(Lib.GetFileName(arFile[i]));
}
let dirPath = Lib.GetDirectoryName(arFile[0]);
if (dirPath == null) { return; }
this.M.fileLoad.loadFiles(dirPath, arName);
else {
this.M.fileLoad.loadFiles(arFile);
}
}

Expand Down Expand Up @@ -1133,6 +1127,16 @@ class ScriptOpen {
WV_RunApp.ProcessStart(exePath, `"${path}"`, true, false);
}

/** 解析多幀圖片 */
public async showFrames(path?: string) {
if (path === undefined) {
path = this.M.fileLoad.getFilePath(); // 目前顯示的檔案
}
let exePath = await WV_Window.GetAppPath();
await this.M.saveSetting();
WV_RunApp.ProcessStart(exePath, `showFrames "${path}"`, true, false);
}

/** 在檔案總管顯示 */
public async revealInFileExplorer(path?: string) {
if (path === undefined) {
Expand Down

0 comments on commit de5c165

Please sign in to comment.