I'm writing a simple application, which basicly loads some pictures and just shows them to the user. The problem is, when I initialize a vertical image which is taken by my phone, it doesn't recognize that the image is vertical and just swaps the width and height.
Otherwise if I load a vertical image, which is for example downloaded from the internet everything works just fine.
Here you see my application and two loaded pictures. The left one is a downloade one and is displayed vertical. But the right one which was taken with my phone isn't displayed vertically.
Here is my Class/Code:
import javafx.scene.CacheHint;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
public class Picture {
String name;
String path;
String res;
String size;
ImageView iv;
Image image;
public Picture(String name, String path) {
this.image = new Image("file:" + path);
this.name = name;
this.path = path;
this.res = image.getWidth() + " x " + image.getHeight();
this.iv = new ImageView(image);
this.iv.setFitHeight(180);
this.iv.setFitWidth(180);
this.iv.setPreserveRatio(true);
this.iv.setCache(true);
this.iv.setCacheHint(CacheHint.SPEED);
this.iv.setStyle("-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0);");
}
}
That's my first question so don't blame me for the layout ;)
Any feedback to my code or question is appreciated. If you need the whole code, just let me know.
Thanks for your help