mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
## Summary Fixes PNG iTXt chunk parsing to comply with the PNG specification. ## Problem The current iTXt parser incorrectly reads the text content immediately after the keyword null terminator, but iTXt chunks have additional fields: - Compression flag (1 byte) - Compression method (1 byte) - Language tag (null-terminated) - Translated keyword (null-terminated) - Text content This caused PNGs that correctly follow the spec to fail loading with JSON parse errors due to leading null bytes. ## Solution Skip the compression flag, method, language tag, and translated keyword fields before reading the text content. Fixes #8150 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8530-fix-properly-parse-PNG-iTXt-chunks-per-specification-2fa6d73d36508189bef4cc5fa3899096) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: github-actions <github-actions@github.com>
57 lines
1.7 KiB
TypeScript
57 lines
1.7 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
|
|
})
|
|
|
|
test.describe(
|
|
'Load Workflow in Media',
|
|
{ tag: ['@screenshot', '@workflow'] },
|
|
() => {
|
|
const fileNames = [
|
|
'workflow.webp',
|
|
'edited_workflow.webp',
|
|
'no_workflow.webp',
|
|
'large_workflow.webp',
|
|
'workflow_prompt_parameters.png',
|
|
'workflow_itxt.png',
|
|
'workflow.webm',
|
|
// Skipped due to 3d widget unstable visual result.
|
|
// 3d widget shows grid after fully loaded.
|
|
// 'workflow.glb',
|
|
'workflow.mp4',
|
|
'workflow.mov',
|
|
'workflow.m4v',
|
|
'workflow.svg'
|
|
// TODO: Re-enable after fixing test asset to use core nodes only
|
|
// Currently opens missing nodes dialog which is outside scope of AVIF loading functionality
|
|
// 'workflow.avif'
|
|
]
|
|
fileNames.forEach(async (fileName) => {
|
|
test(`Load workflow in ${fileName} (drop from filesystem)`, async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.dragAndDropFile(`workflowInMedia/${fileName}`)
|
|
await expect(comfyPage.canvas).toHaveScreenshot(`${fileName}.png`)
|
|
})
|
|
})
|
|
|
|
const urls = [
|
|
'https://comfyanonymous.github.io/ComfyUI_examples/hidream/hidream_dev_example.png'
|
|
]
|
|
urls.forEach(async (url) => {
|
|
test(`Load workflow from URL ${url} (drop from different browser tabs)`, async ({
|
|
comfyPage
|
|
}) => {
|
|
await comfyPage.dragAndDropURL(url)
|
|
const readableName = url.split('/').pop()
|
|
await expect(comfyPage.canvas).toHaveScreenshot(
|
|
`dropped_workflow_url_${readableName}.png`
|
|
)
|
|
})
|
|
})
|
|
}
|
|
)
|