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

glTF images with data URI lose their URI during parsing #497

Closed
ptc-tgamper opened this issue Jul 31, 2024 · 2 comments
Closed

glTF images with data URI lose their URI during parsing #497

ptc-tgamper opened this issue Jul 31, 2024 · 2 comments
Labels

Comments

@ptc-tgamper
Copy link
Contributor

ptc-tgamper commented Jul 31, 2024

Describe the issue

During parsing of glTF Images that store their data in a data URI, the latter is discarded. Only images that reference an external file keep their URI, see

image->uri = uri;

Therefore, when one uses a custom image loader that leaves image.image empty, the image data cannot be loaded later from the original data URI.

To Reproduce

  • OS
  • Compiler, compiler version, compile options
  • Please attach minimal and reproducible .glTF file if you got an issue related to .glTF data

Expected behaviour

The image's URI should not be discarded if it is not loaded into image.image

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context
We are using a custom image loaderto avoid loading images into memory, since our models have Gigabytes of images. Naturally then the custom image writer needs to have access to the original image data. But the original image.uri has been lost during parsing.

ptc-tgamper added a commit to ptc-tgamper/tinygltf that referenced this issue Jul 31, 2024
Do not discard image data uri if uri still needed
@syoyo syoyo added the question label Aug 2, 2024
@syoyo
Copy link
Owner

syoyo commented Aug 3, 2024

You should describe the issue in clear manner. Also should attach minimal reproducible code&gltf file.

@syoyo syoyo closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2024
@ptc-tgamper
Copy link
Contributor Author

ptc-tgamper commented Aug 5, 2024

#498 has a respective test case. It generates a glTF file that shows the problem on the fly.

I can rework the description here, if that is ok? And attach a glTF that shows the problem.

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

No branches or pull requests

2 participants