- This topic has 5 replies, 3 voices, and was last updated 11 years, 11 months ago by support-michael.
-
AuthorPosts
-
GasToneMemberHi Support Team,
I’m able to import a picture from photoalbum in my app using below code:
function settings_take_avatar() { navigator.camera.getPicture(onSuccess, onFail, { quality: 70, destinationType: Camera.DestinationType.DATA_URL, sourceType : Camera.PictureSourceType.SAVEDPHOTOALBUM, targetWidth: 400, targetHeight: 400 }); } function onSuccess(imageURL) { var smallImage = document.getElementById('m1-settings-myImage'); smallImage.src = "data:image/jpeg;base64," + imageURL; } function onFail(message) { alert('Failed because: ' + message); }
The m1-settings-myImage is an image widget having as below:
The problem is that every time i get the image from photoalbum, it is always rendered to 200 x 200, irrespective if it is landscape or portrate…
I expect the image is placed in the 200 x 200 image widget, with maximum side at 200 and smaller size accordingly to picture’s aspect ratio…eg. if image il 1000 x 500 (landscape case) -> in my widget shall appear as 200 x 100…
The check “keep aspect ratio” in the design center doesn’t provide any effect… I’m not sure the issue is due to phonegap 1.1.0 bug CB-1008…
However: is there a way to take a picture from photoalbum and place it in an image widget maintaining the picture’s original aspect ratio?
thanks
\gastone
support-octavioMemberHi GasTone,
I’m discussing your request with the dev team. Will follow up with you as soon as I have more information.
support-michaelKeymasterBeen thinking about your problem description. I will try to follow up tomorrow. I’m not exactly sure but I don’t think the layout engine is responding to change of an image src…. verifying this.
>However: is there a way to take a picture from photoalbum and place it in an image widget maintaining the picture’s original aspect ratio?
support-michaelKeymasterHere is my understanding of the situation. In MobiOne 2.2, the image “keep aspect ratio” property was introduced. The code generation services recognize the design-time image aspect ratio. When the image.src is dynamically updated the layout engine is not recognizing there is a new image with potentially different properties. I have discussed this matter with the dev team. They shared with me that the code generation services need to be updated to support dynamic images. We have a bug to track this improvement need.
GasToneMemberHi Wayne,
two questions (please answer both):
ONE) so far this is a blocking issue for me; I need to get a picture from album and display it correctly! can you please investigate any workaround using css and/or getting impored image properties ? PLEASE HELP, it is blocking…
TWO) when will you release new version? regarding new features, iScroll improvement is widely announced but it is still a big limitation (see http://cubiq.org/iscroll-4 having pull to refresh, but also have a look to http://cubiq.org/infiniwall too), date keeper, swap view (have a look to http://cubiq.org/swipeview), additional fonts … just to mention my needs… talking about bugs, I suffer about jumping page with input text fields…
Thanks a lot
\gastone
support-michaelKeymaster> I need to get a picture from album and display it correctly! can you please investigate any workaround using css and/or getting impored image properties ? PLEASE HELP, it is blocking..
We have a possible solution recently checked in and being QA’ed. We should know if/how well it works tomorrow or early next week. We are preparing an early release of a mobione 2.3 version that includes many improvements. I know we have an iscroll4 implementation on a test branch. I can’t say if it will be in scope or not yet for this upcoming version.
-
AuthorPosts