model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

fix: Improve HDR texture loading for blob URLs by checking content type

Open samaneh-kazemi opened this issue 8 months ago • 0 comments

model-viewer currently checks if the URL ends with .hdr using HDR_FILE_RE.test(url)

  • If it does, it uses the hdrLoader (RGBELoader)
  • If it doesn't, it uses the imageLoader (HDRJPGLoader)

The problem is that when we create a blob URL, it doesn't have the .hdr extension, so it's defaulting to the HDRJPGLoader. We can fix this by modifying the code to check the content type instead of the file extension.

samaneh-kazemi avatar Jun 11 '25 00:06 samaneh-kazemi