# Issue with image width and height

**URL:** <https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532>\
**Category:** Ignition\
**Created:** [May 7, 2020, 5:02pm UTC](https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532 "2020-05-07T17:02:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikeAMCO](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MikeAMCO](https://forum.inductiveautomation.com/u/MikeAMCO)\
**Post date:** [May 7, 2020, 5:02pm UTC](https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532/1 "2020-05-07T17:02:44Z")

</div>

When I load images from files, at times the width and height properties are swapped. This effect seems to happen with “larger” images such as 3000 X 4000 pixels.

Here are some screenshots which show the image directly from the file and its width and height:

A large 3000 X 4000 image

 ![ImageExample1](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d5b79a577246e9d0ef99ce8e554fee58ad82f344.jpeg)

Properties of large image

 ![ImageExample1_Properties](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/61feac6602e34ce96c53a2012831debe62e25796.png)

A smaller 720 X 1280 image

 ![ImageExample2](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2af2250657644f67a42f571dbe5d06930aae3a34.jpeg)

Properties of smaller image

 ![ImageExample2_Properties](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d456ac78e3a639a268f4c4a43d9928f72392a391.png)

Here are two screenshots from the designer showing the rendered images. Please note how the larger file´s width and height were swapped.

In this image the width and height were swapped:

 ![Screenshot - Large image with console printed width and height](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bb61748972bc90195791492db61330e7c5b48538.png)

No issue with this image:

 ![Screenshot - Small image with console printed width and height](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a492be00f4c074e60660498a84acd7822e842efb.png)

Below is the code:

```auto
	#Find Aspect Ratio of Original Image
	filename = imgComponent.getPath()
	img = ImageLoader.getInstance().loadImageNoCache(filename, None) #this line causes the JVM heap error in the client or designer 
	imgW = img.getWidth()
	imgH = img.getHeight()
	print "Width = ", imgW
	print "Height = ", imgH
	imgRatio = float(imgW) / float(imgH)

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![MikeAMCO](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MikeAMCO](https://forum.inductiveautomation.com/u/MikeAMCO)\
**Post date:** [May 12, 2020, 9:20pm UTC](https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532/2 "2020-05-12T21:20:55Z")

</div>

Just checking back to see if there are any ideas.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 12, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532/3 "2020-05-12T21:40:16Z")

</div>

I don’t think the width/height are swapped, I think Windows Preview is auto-rotating the image for you, possibly using orientation metadata, while the image you load and display in Vision is unmodified.

---

<div class="post-metadata">

**Author:** ![MikeAMCO](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MikeAMCO](https://forum.inductiveautomation.com/u/MikeAMCO)\
**Post date:** [May 14, 2020, 2:59pm UTC](https://forum.inductiveautomation.com/t/issue-with-image-width-and-height/34532/4 "2020-05-14T14:59:42Z")

</div>

Thank you Kevin. Makes sense.
