Fix loading large workflow embedded in webp (#777)

* Fix loading large workflow embedded in webp

* Update test expectations [skip ci]

* nit

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-11 10:12:01 +09:00
committed by GitHub
parent 15758101aa
commit 06a05cb283
4 changed files with 13 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

View File

@@ -2,12 +2,15 @@ import { expect } from '@playwright/test'
import { comfyPageFixture as test } from './ComfyPage'
test.describe('Load Workflow in Media', () => {
;['workflow.webp', 'edited_workflow.webp', 'no_workflow.webp'].forEach(
async (fileName) => {
test(`Load workflow in ${fileName}`, async ({ comfyPage }) => {
await comfyPage.dragAndDropFile(fileName)
await expect(comfyPage.canvas).toHaveScreenshot(`${fileName}.png`)
})
}
)
;[
'workflow.webp',
'edited_workflow.webp',
'no_workflow.webp',
'large_workflow.webp'
].forEach(async (fileName) => {
test(`Load workflow in ${fileName}`, async ({ comfyPage }) => {
await comfyPage.dragAndDropFile(fileName)
await expect(comfyPage.canvas).toHaveScreenshot(`${fileName}.png`)
})
})
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -50,8 +50,8 @@ function parseExifData(exifData) {
let value
if (type === 2) {
// ASCII string
value = String.fromCharCode(
...exifData.slice(valueOffset, valueOffset + numValues - 1)
value = new TextDecoder('utf-8').decode(
exifData.subarray(valueOffset, valueOffset + numValues - 1)
)
}