Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Portrait images have wrong orientation (Titanium 9.1.0 + Android 10) #92

Closed
m1ga opened this issue Aug 8, 2020 · 1 comment

Comments

@m1ga
Copy link
Contributor

m1ga commented Aug 8, 2020

Currently debugging a strange problem with my app and Ti 9.1.0 (nightly build).
Some of my images (taking from the gallery or taking it with the camera) in portrait mode are rotated to landscape.

Device: Pixel 4, Android 10
Ti SDK: 9.1.0 (nightly)
Image should have exif: top right and is in portrait mode.

It is working with 9.0.3.GA. Already built a new glide version (they've updated the exif library) + module but still having the same issue. If I use the normal imageview it has the correct orientation but of course no aspect_fill.

var window = Ti.UI.createWindow({
	title: "Image Test"
});

var AvImageview = require("av.imageview");
var imageView =AvImageview.createImageView({
	width: Ti.UI.FILL,
	height: 200,
	top: 0,
	contentMode: AvImageview.CONTENT_MODE_ASPECT_FILL,
});
window.add(imageView);
var dl = Ti.UI.createButton({
	title: "open image",
	bottom: 10,
});
dl.addEventListener("click", function(e) {
	Ti.Media.openPhotoGallery({
		success: function(e) {
			var w = e.media.width;
			var h = e.media.height;

			var r = h / w;
			w = 1024;
			h = r * w;

			var imageBlob = e.media.imageAsResized(w, h);
			imageView.image = imageBlob;
		}
	});
});

window.add(dl);
window.open();

(allow permissions to gallery manually)

@m1ga
Copy link
Contributor Author

m1ga commented Sep 9, 2020

tidev/titanium-sdk#11999
That will help to fix it in Titanium. TiBlob is switching the values in 9.1.0 (https://github.com/appcelerator/titanium_mobile/blob/7ce3ae11f2c886864ed7713b1e88324b60fdf8f6/android/titanium/src/java/org/appcelerator/titanium/TiBlob.java#L756-L758) to fix other rotated images.

some more details/information in this ticket: https://jira.appcelerator.org/browse/AC-6582

@m1ga m1ga closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant