QuickLook PVR plugin Pt.3

I’ve just pushed a new version of QuickPVR to GitHub. It does now also support Apple PVRTC.

Because those files don’t contain _any_ metadata at all, just the raw image data, and they usually use the same extension, I had to somehow detect the right format. The good thing is that PVRTC compressed textures come in only few different sizes, either res*res/2 (4bpp) or res*res/4 (2bpp), where res is a power of 2, greater than or equal to 8. Hence I look out for these sizes when I can’t find the PowerVR .pvr header in the file. To discern 2bpp and 4bpp, notice that the file sizes for both types are actually disjoint. res grows in factors of 2, so the file size grows by a factor of 4. Because there is a factor of 2 between 4bpp and 2bpp you can use that to detect the format of the file.
Check out the new and better QuickPVR here:

5 thoughts on “QuickLook PVR plugin Pt.3

  1. whoops, should read "now" instead of "not" 🙂

    about your file, it was encoded using an old version of pvrtextool where the number of surfaces stored is specified as 0. i've added a small hack to set it to 1 in that case, and how it can be displayed. git pull the latest for the fix.

    Thanks for your great feedback!

  2. Nice, it works now, thank you!

    Small bug: the image is displayed upside down (Y axis is flipped) ;).

    And no problem with the feed back, I think this could be of real use to the development community as the mac does not come with any pvr viewing tools…

  3. Alright, I'll check the flags, maybe there is some flipping bit. All of the test images in the project work correctly now, but i guess there may be some other encoding methods i missed… just keep sending me the issues 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *