Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Use wuffs/fpng for reading/writing images with better security and performance #410

Open
3 of 5 tasks
syoyo opened this issue Mar 30, 2023 · 2 comments
Open
3 of 5 tasks

Comments

@syoyo
Copy link
Owner

syoyo commented Mar 30, 2023

Describe the issue

TinyGLTF currently uses stb_image, stb_image_write for reading/writing images.
STB library is easy to use and embed, but has some security issues and slow to decode/encode(especially PNG)

are good alternative for reading/writing images with security/performance considered.

Support matrix

  • JPEG decoding: wuffs
  • JPEG encoding: No support in wuffs. We still need stb_image_write to encode JPEG
  • PNG decoding: wuffs or fpng
  • PNG encodng: fpng

Expected behaviour

Add support to use wuffs and fpng(for PNG) for better security and performance.
We also need a compile flag to disable using SIMD instrinsic for portability.

@syoyo
Copy link
Owner Author

syoyo commented May 24, 2023

wuffs jpeg decoder has been implemented: https://github.com/google/wuffs/blob/main/doc/std/image-decoders.md

Use wuffs-unsupported-snapshot.c for a while: https://github.com/google/wuffs/blob/main/release/c/wuffs-unsupported-snapshot.c
(v0.3 does not support JPEG decoding)

@syoyo
Copy link
Owner Author

syoyo commented May 24, 2023

Created wuffs branch: https://github.com/syoyo/tinygltf/tree/wuffs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant