Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Learn More

Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.

Cannot load webgl texture using "data:image/jpg;base64" style URI. This is forcing me to download texture files explicitly, rather than embed them in my binary buffer.

  • 1 відповідь
  • 3 мають цю проблему
  • 2 перегляди
  • Остання відповідь від knorretje

more options

I am creating a webgl texture using following technique:

var textureBuffer = new Uint8Array(this.modeldataBuffer, sourceImage.data.offset, sourceImage.data.size);

var image = new Image();
var binary = '';

for (var i = 0, l = textureBuffer.byteLength; i < l; i++) {
     binary += String.fromCharCode(textureBuffer[i]);
}

image.src = "data:image/" + sourceImage.type + ";base64," + window.btoa(binary);

Now use this image to create WebGL texture, which fails and throws following error:

Error: uncaught exception: [Exception... "Failure arg 5 [nsIDOMWebGLRenderingContext.texImage2D]” nsresult: “0×80004005 (NS_ERROR_FAILURE)” location: “JS frame :: loadmodel.js:: line 446″ data: no]


This used to work in FF5, but seems to have been broken in FF6. Is this intentional (i.e. part of cross-domain security fix) or a bug?

This will force me to download individual textures...much more slower than loading it from a single binary file.

I am creating a webgl texture using following technique: <pre><nowiki>var textureBuffer = new Uint8Array(this.modeldataBuffer, sourceImage.data.offset, sourceImage.data.size); var image = new Image(); var binary = ''; for (var i = 0, l = textureBuffer.byteLength; i < l; i++) { binary += String.fromCharCode(textureBuffer[i]); } image.src = "data:image/" + sourceImage.type + ";base64," + window.btoa(binary);</nowiki></pre> ------------------------------------------------------------ Now use this image to create WebGL texture, which fails and throws following error: Error: uncaught exception: [Exception... "Failure arg 5 [nsIDOMWebGLRenderingContext.texImage2D]” nsresult: “0×80004005 (NS_ERROR_FAILURE)” location: “JS frame :: loadmodel.js:: line 446″ data: no] This used to work in FF5, but seems to have been broken in FF6. Is this intentional (i.e. part of cross-domain security fix) or a bug? This will force me to download individual textures...much more slower than loading it from a single binary file.

Змінено cor-el

Усі відповіді (1)

more options

I think this is part of the cross-domain security fix for web-gl textures. See cross domain texture