title: Aspect ratio incorrect imported image unity editor script
body: <p>I have written a script that should make sure the aspect ratio of my image stays the same when i import it into unity.<br>
  This is the script:</p>
  
  <pre><code>public class PostprocessImages : AssetPostprocessor
  {
      void OnPostprocessTexture(Texture2D texture)
      {
          TextureImporter textureImporter = (TextureImporter)assetImporter;
          textureImporter.npotScale = TextureImporterNPOTScale.None;
          textureImporter.mipmapEnabled = false;
      }
  }
  </code></pre>
  
  <p>the script is located in the Editor folder in Assets.
  But when i import an image i get the following result: </p>
  
  <p><a href="https://i.stack.imgur.com/ifhSK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ifhSK.png" alt="enter image description here"></a> </p>
  
  <p>this is definitly not what i am looking for.<br>
  It should look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/dlvGH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dlvGH.png" alt="enter image description here"></a></p>
  
  <p>But when i just go to the inspector of the imported image and change a random setting and hit apply the texture does get the proper aspect ratio back. And the settings i modified in the code. Are correct when i inspect the image. But the image doesnt have the right aspect ration..<br>
  See image below: </p>
  
  <p><a href="https://i.stack.imgur.com/Ockwv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ockwv.png" alt="enter image description here"></a></p>
  
  <p>how would i go about making the image have the right aspect ratio, right from the getgo (when i import it). Because i dont want to do it manual since i have to import hundereds of images.   </p>
  
  <p>Let me know if something is unclear so i can clarify. </p>