Skip to content

Conversation

@SameDesu123
Copy link
Contributor

PR Checklist

  • Have you checked if it works normally in all models? Ignore this if it doesn't use models.
  • Have you checked if it works normally in all web, local, and node hosted versions? If it doesn't, have you blocked it in those versions?
  • Have you added type definitions?

Description

Refactors the PNG file reading process to improve performance, especially for large files on mobile devices.

  • In persona.ts, replaces the synchronous PngChunk.read with the asynchronous PngChunk.readGenerator to avoid blocking the main thread during persona imports.

  • In pngChunk.ts, the readGenerator is updated to use the File.stream() API. This provides a more efficient way to read local files, reducing memory overhead and processing time compared to the previous File.slice() and FileReader implementation.

SameDesu123 and others added 2 commits August 11, 2025 13:04
Refactors the PNG file reading process to improve performance, especially for large files on mobile devices.

- In `persona.ts`, replaces the synchronous `PngChunk.read` with the asynchronous `PngChunk.readGenerator` to avoid blocking the main thread during persona imports.

- In `pngChunk.ts`, the `readGenerator` is updated to use the `File.stream()` API. This provides a more efficient way to read local files, reducing memory overhead and processing time compared to the previous `File.slice()` and `FileReader` implementation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@kwaroran kwaroran merged commit 3a73b8d into kwaroran:main Aug 12, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants