mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 06:44:32 +00:00
[backport core/1.38] fix: handle RIFF padding for odd-sized WEBP chunks (#8794)
Backport of #8527 to `core/1.38` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-8794-backport-core-1-38-fix-handle-RIFF-padding-for-odd-sized-WEBP-chunks-3046d73d36508174afc8cdd8cd791169) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: GitHub Action <action@github.com>
This commit is contained in:
@@ -124,7 +124,9 @@ export function getWebpMetadata(file: File) {
|
||||
break
|
||||
}
|
||||
|
||||
offset += 8 + chunk_length
|
||||
// RIFF spec requires odd-sized chunks to be padded with a single byte
|
||||
// https://developers.google.com/speed/webp/docs/riff_container#riff_file_format
|
||||
offset += 8 + chunk_length + (chunk_length % 2)
|
||||
}
|
||||
|
||||
r(txt_chunks)
|
||||
|
||||
Reference in New Issue
Block a user