A lot of images do not show the correct orientation, at least not the one that shows in the Windows Explorer and in image editors.
For a lot of images, after I have loaded them from the harddrive with loadimage(), and then put them on the canvas with image(), will show in landscape format, when the image was actually taken on my phone in portrait format, and shows that way (correctly) in Windows Explorer and in any other image programs.
Its annoying, as I want to put together a photo album, but cannot do it nicely due to this error.
Can you post a sample image that displays this behavior? Can we see a sample of your code that is loading and drawing the images?
It’s possible that there is some metadata in the images that describes the orientation, which Processing is ignoring. If this really is the case, it’s a bug/oversight.
Sure. Also thought that it might be an issue with metadata, but if it is, I have no clue how to solve.
Below you find the code. Its very simply. It loads 8 example images (jpg), resizes them, draws them onto the canvas and saves the canvas as a jpg. All 8 images are in portrait mode, but processing recognizes only 2 in portrait, and paints the rest in landscape mode.
void draw() {
int i;
int x;
int y;
int w;
int h;
float fact;
PImage img;
int rect = 200;
fact=0.05;
x=50;
y=50;
for(i=1;i<=8;i++) {
img = loadImage(i+".jpg"); //loading image from harddrive
// downsizing image size so they better fit onto a canvas
w = int(img.width*fact);
h = int(img.height*fact);
img.resize(w,h);
image(img,x,y); // "painting" image on canvas
y = y + h + 20;
}
save("final.jpg"); //output final file
one more note: I just used imagemagick to batch-update with auto-orientation on all files. processing now recognizes all files with correct orientation.
However, it should have been able to do that without me using imagemagick first, as windows and image editors were able to recognize the correct orientation.