question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preserve MIME type for unknown extensions during import

See original GitHub issue

Hi @najadojo, hope you’re doing well! Here’s a suggestion from @rawnsley and Mozilla Hubs.

During GLB to GLTF conversion, it might be good to preserve the mimeType field, at least for types that are unknown to the guessFileExtension function. This would enable RGBE environment maps that Hubs has an extension for. Even if these files got a .bin extension, they would have a MIME type applied.

via https://github.com/AnalyticalGraphicsInc/gltf-vscode/issues/243

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
najadojocommented, May 18, 2022

@rawnsley and @emackey I’ve merged a change and published the npm package that addresses this. Here is a section of the sample gltf after conversion:

{
  "images": [
    {
      "name": "skybox",
      "uri": "hubs-scene-sample-dw0.1.0_img0.png"
    },
    {
      "name": "envmap-category",
      "mimeType": "image/vnd.radiance",
      "uri": "hubs-scene-sample-dw0.1.0_img1.bin"
    },
    {
      "name": "lightmap",
      "mimeType": "image/vnd.radiance",
      "uri": "hubs-scene-sample-dw0.1.0_img2.bin"
    },
    {
      "name": "WoodFloor040_4K_Color",
      "uri": "hubs-scene-sample-dw0.1.0_img3.ktx2"
    }
  ],
  "buffers": [
    {
      "uri": "hubs-scene-sample-dw0.1.0_data.bin",
      "byteLength": 33384
    }
  ]
}
0reactions
rawnsleycommented, May 18, 2022

🤯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Properly configuring server MIME types - MDN Web Docs
Modern versions of Apache report none for files with unknown content types. Nginx will report text/plain if you don't define a default content...
Read more >
Import of Mime Type Xlsm File Returns Error "Unknown File ...
1. From Workspace menu, select File->Import->File. · 2. Click on Choose File button. · 3. Select a file with .xlsm extension and click...
Read more >
Unknown file type MIME?
Short answer: Do not send MIME type for unknown data. To be more clear: Do not use Content-Type header at all. References:.
Read more >
Configuration: Allowed MIME Types for Document Upload
When checking documents, the system assigns unknown MIME types to the application/octet-stream MIME type. If you define the application/octet-stream MIME type ...
Read more >
If a file has an extension that is not supported by any of the ...
In your specific case, the file was an unknown file format, so it was recognized as a generic binary document. If you are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found