- Home /
Get the original size of a texture
Im loading textures from the resources folder. When i check the width and height of the textures the output is 128x128. The original size of the textures are 150x120. How can i get the original size of the texture when loading them this way?
@landon91235: No, it uses whatever settings you tell it to use.
Please see my hack (http://pastebin.com/J6wqU8ax) and consider voting here: http://feedback.unity3d.com/unity/all-categories/1/hot/active/get-original-width-and-height-of
Answer by SarperS · Sep 30, 2012 at 10:56 PM
In the import settings, set the "Non power of two" option to "None" and Unity will import them in their original sizes. Then you can get them that way. Warning though, you won't be able to compress them into PVRTC if they are NPOT.
I set the npotscale to none and isreadable via code and the output is still the same: 128x128. If i try to manually Resize the texture it says it is not readable.
I checked the importer settings and the importer does get set to npotscale : none and read/write flag is set to true. Any ideas here?
@eric5h5 im doing the changes via code in an editor script, i dont see an exposed property or method for Apply() in the TextureImporter. The changes seem to be applied automatically. The changes do show up in the texture importer via the inspector.
Your answer

Follow this Question
Related Questions
Loading in textures dynamically without using Resources 1 Answer
Assigning UV Map to model at runtime 0 Answers
Effects to make space seem far away 1 Answer
Shader light fix? 1 Answer
Change GUI.Button Texture on runtime 1 Answer