# Error KTX2Loader: .transcodeImage failed

**URL:** <https://discourse.threejs.org/t/error-ktx2loader-transcodeimage-failed/32452>\
**Category:** Questions\
**Tags:** loaders\
**Created:** [December 7, 2021, 12:05pm UTC](https://discourse.threejs.org/t/error-ktx2loader-transcodeimage-failed/32452 "2021-12-07T12:05:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dexylon](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dexylon/32/17329_2.png) [@Dexylon](https://discourse.threejs.org/u/Dexylon)\
**Post date:** [December 7, 2021, 12:05pm UTC](https://discourse.threejs.org/t/error-ktx2loader-transcodeimage-failed/32452/1 "2021-12-07T12:05:15Z")

</div>

I’m trying to load a gltf with some ktx2 textures. With some models it works correctly, but with others it throws the following error:

 ![error_log](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/b/7ba1f84b3ddfbaf89ee6c957c2fc6fe531b62976.png)

I tried [https://gltf-viewer.donmccurdy.com/](https://gltf-viewer.donmccurdy.com/) viewer from @donmccurdy and it works as expected. I use the following code to load the gltf:

```javascript
  const loader = new GLTFLoader();
  const loaderKTX2 = new KTX2Loader();
  loaderKTX2.setTranscoderPath('scripts/basis/');
  loaderKTX2.detectSupport(renderer);
  loader.setKTX2Loader(loaderKTX2);

  const loadedData = await loader.loadAsync(modelUrl);

  loaderKTX2.dispose();

```

Any suggestions will be greatly appreciated! 🙂

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [December 7, 2021, 6:22pm UTC](https://discourse.threejs.org/t/error-ktx2loader-transcodeimage-failed/32452/2 "2021-12-07T18:22:38Z")

</div>

I haven’t seen this error before and am not quite sure what to make of it. Would you be able to share a demo?

If you’re loading more than one model, it might be worth trying to reuse the same KTX2Loader across all of them.

---

<div class="post-metadata">

**Author:** ![Dexylon](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dexylon/32/17329_2.png) [@Dexylon](https://discourse.threejs.org/u/Dexylon)\
**Post date:** [December 8, 2021, 11:15am UTC](https://discourse.threejs.org/t/error-ktx2loader-transcodeimage-failed/32452/3 "2021-12-08T11:15:32Z")

</div>

I was debugging and I saw that the ktx file was incorrectly uploaded to the server. Now it’s working perfectly, thank you!
