Images Rotate Themselves

I was working on a larger project and noticed that every time I try import a photo that I rotated in Windows, it rotates it back. I have made a basic example with the same photo to test it and it still occurs. Does anyone know what might be causing this? This is in Processing 3.

void setup() {
 size(500, 500);
  PImage photo;
 photo = loadImage("DSCN4885  Vert.JPG");
 image(photo, 0, 0);
}

To reproduce, try the above code, find a photo in Windows, right click and select rotate then copy and paste into data folder of sketch

It displays the rotated image on me. Windows 10.

So I just did some research into how rotation is stored in photos and it appears Processing uses the Exif info instead of the current info like in Windows photoviewer and explorer

1 Like