# Loading KTX2 file with PVRTexLib.lib

**URL:** <https://forums.imgtec.com/t/loading-ktx2-file-with-pvrtexlib-lib/3568>\
**Category:** PowerVR Insider\
**Tags:** pvrtextool\
**Created:** [August 1, 2022, 8:47am UTC](https://forums.imgtec.com/t/loading-ktx2-file-with-pvrtexlib-lib/3568 "2022-08-01T08:47:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hayashi](https://avatars.discourse-cdn.com/v4/letter/h/439d5e/32.png) [@Hayashi](https://forums.imgtec.com/u/Hayashi)\
**Post date:** [August 1, 2022, 8:47am UTC](https://forums.imgtec.com/t/loading-ktx2-file-with-pvrtexlib-lib/3568/1 "2022-08-01T08:47:58Z")

</div>

I am developing a plugin to import glTF for 3dsMax.  
I’m trying to convert KTX2 to PNG using PVRTexLib, So I implemented the code:

> **[Reading and Transcoding an Image](https://docs.imgtec.com/tools-manuals/pvrtextool/topics/library/reading-decompressing.html)**
>
> In this example, an existing file is read from disk and then transcoded to RGBA8888. The resulting texture object can then be used for later processing. #include "PVRTexLib.hpp" using namespace ...

But it does not seem to load the KTX2 image.(m\_hTexture=0)  
I use Khronos glTF sample data and not a special image, but do I need to do any initialization before loading?

> **[glTF-Sample-Models/2.0/StainedGlassLamp/glTF-KTX-BasisU at master ·...](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/StainedGlassLamp/glTF-KTX-BasisU)**
>
> master/2.0/StainedGlassLamp/glTF-KTX-BasisU

Thanks,

---

<div class="post-metadata">

**Author:** ![Nagnath](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@Nagnath](https://forums.imgtec.com/u/Nagnath)\
**Post date:** [August 3, 2022, 6:32am UTC](https://forums.imgtec.com/t/loading-ktx2-file-with-pvrtexlib-lib/3568/2 "2022-08-03T06:32:39Z")

</div>

Hi Hayashi,

Welcome to the PVR Developer forum and thank you for reporting the issue for KTX2 file formats. We have found it to be a bug with PVRTexLib and the same has been fixed internally. For us to be able to share the internal build with you, we would like you to register and raise a ticket in our support portal, [PowerVR Insider Support] [https://pvrsupport.imgtec.com](https://pvrsupport.imgtec.com).

Thanks,  
Nagnath
