# Loading textures from memory in PVRTexLib

**URL:** <https://forums.imgtec.com/t/loading-textures-from-memory-in-pvrtexlib/3736>\
**Category:** PowerVR Insider\
**Tags:** pvrtextool\
**Created:** [June 30, 2023, 8:08pm UTC](https://forums.imgtec.com/t/loading-textures-from-memory-in-pvrtexlib/3736 "2023-06-30T20:08:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaniilSV](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/daniilsv/32/499_2.png) [@DaniilSV](https://forums.imgtec.com/u/DaniilSV)\
**Post date:** [June 30, 2023, 8:08pm UTC](https://forums.imgtec.com/t/loading-textures-from-memory-in-pvrtexlib/3736/1 "2023-06-30T20:08:26Z")

</div>

Hey, I’m developing an application that needs to load multiple textures (mostly ktx1 or ktx2) in one big binary file that I load into memory and read.  
I want to use PVRTexLib to get an uncompressed array of pixels but the problem is that API has only one constructor to load from memory and as constructor description says “Header may be any version of PVR.”. I assumed that constructor could only load pvr but still i tried to load ktx hoping for luck and i just got an error about a invalid data pointer.  
I also looked at all examples, but none of them have anything that can relate to loading textures from memory.  
As a workaround, I can save texture buffer to a temporary file and then read it, but this is not a very elegant way.

So, is there any way to load ktx file directly from memory using PVRTexLib?

---

<div class="post-metadata">

**Author:** ![unibodydesignn](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/unibodydesignn/32/476_2.png) [@unibodydesignn](https://forums.imgtec.com/u/unibodydesignn)\
**Post date:** [July 3, 2023, 8:31am UTC](https://forums.imgtec.com/t/loading-textures-from-memory-in-pvrtexlib/3736/2 "2023-07-03T08:31:10Z")

</div>

Hi DaniilSV,

Welcome to PVR Developer Forum!

It would be good for us to test and investigate the issue if you share the code example you are trying with KTX textures.

Kindly raise a ticket on our internal support platform:  
[https://pvrsupport.imgtec.com](https://pvrsupport.imgtec.com)

Regards,  
Melih
