I use Titanium. I test with an Android nexus S.
I’ve got a blob which is a photo from the gallery. I can’t find a way to get the width and height of this photo.
I’ve seen some tips with the auto property but this tip seems to not run since titanium 2.0.
First try
Ti.Media.openPhotoGallery({
success : function(e) {
alert(e.media.width + " x " + e.media.height);
}});
Result “0 x 0”
Second try
Ti.Media.openPhotoGallery({
success : function(e) {
var img = Ti.UI.createImageView({
image : e.media,
width: 'auto',
height: 'auto' });
alert(img.width + " x " + img.height);
}});
Result “auto x auto”
So, my simple question:
How can I get size of a photo obtained from the gallery ?
After another few tries (during the wrote of this question), I’ve found it:
the tip is to use img.toImage().width