# resize problem

**URL:** <https://forums.imgtec.com/t/resize-problem/1428>\
**Category:** PowerVR Insider\
**Tags:** pvrtextool\
**Created:** [May 30, 2012, 3:20am UTC](https://forums.imgtec.com/t/resize-problem/1428 "2012-05-30T03:20:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjay](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jjay](https://forums.imgtec.com/u/jjay)\
**Post date:** [May 30, 2012, 3:20am UTC](https://forums.imgtec.com/t/resize-problem/1428/1 "2012-05-30T03:20:33Z")

</div>

hi all,

i got a problem while calling the function&nbsp;pvrtexture::Resize in&nbsp;PVRTexLib.lib

  

code here:

  

pvrtexture theTexture( filename );

pvrtexture::Resize( theTexture, Width, Height, theTexture.getHeader().getDepth(), pvrtexture::EResizeMode::eResizeNearest );

  

pvrtexture::PixelType PVRTC4BPP( ePVRTPF\_PVRTCI\_4bpp\_RGBA ); // Compress to PVRTC 4bpp.

pvrtexture::Transcode( theTexture, PVRTC4BPP, ePVRTVarTypeUnsignedInteger, ePVRTCSpacelRGB );

theTexture.saveFile( &nbsp;sTheDstFilename.c\_str() ); // Save the file

  

but the resize function return false;

is there anything i should set before Resize??

  

but Resize in PVRTexTool.exe works well.

  

besides, there seems some flaw appear while read dds file into the pvrtextool gui version, looks like black spots,

but TGA file doesn’t, any idea will be grateful!

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [May 30, 2012, 7:38am UTC](https://forums.imgtec.com/t/resize-problem/1428/2 "2012-05-30T07:38:49Z")

</div>

Hi Jjay,  
  
TexTool will automatically decompress an image to a standard format before it works on it. TexLib simply loads it into memory, so you’ll need to transcode it to a standard format before working on it&nbsp; - (See: PVRTextureFormat.h which contains identifiers for standard formats, which need to be used alongside unsigned, normalised variable types. E.g.  
&nbsp;“Transcode( theTexture, PVRStandard8PixelType, ePVRTVarTypeUnsignedByteNorm, ePVRTCSpacelRGB );”).  
  
Once you’ve done this it should work assuming the texture load worked alright - this can be checked by calling “theTexture.getTextureFormat()” which will be equal to “ePVRTPF\_NumCompressedPFs” if it’s invalid.  
  
As for the DDS files - this is a bug in previous versions with the dxt decompression routine - if you update to the latest version on the website this issue has been fixed.  
  
Thanks,  
  
Tobias

---

<div class="post-metadata">

**Author:** ![jjay](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jjay](https://forums.imgtec.com/u/jjay)\
**Post date:** [June 1, 2012, 5:31am UTC](https://forums.imgtec.com/t/resize-problem/1428/3 "2012-06-01T05:31:47Z")

</div>

Thanks for your reply, its useful!
