ios - Take square image with Cordova (Phonegap) Camera API? -
i have coded camera api take , save photos (on ios). however, want photos square (like instagram).
i have set targetwidth
, targetheight
same pixels images still comes out portrait or landscape, depending on how phone held.
my complete api code is:
navigator.camera.getpicture(onphotodatasuccess, onfail, { quality: 50, targetwidth: 600, targetheight: 600, correctorientation: 1, savetophotoalbum: 1 });
does know how save square photo api on ios devices?
during tests realized same thing, intention opposite. wanted preserve picture's full dimensions, while camera on, "square overlay" shown, implying content inside square saved.
then, changed "allowedit" parameter "false" instead of "true". can save full picture. in case, can see not using parameter, maybe should add in code. example:
navigator.camera.getpicture(onphotosuccess, onphotofail, { quality : 40, allowedit : false, destinationtype : navigator.camera.destinationtype.data_url, encodingtype : navigator.camera.encodingtype.png, sourcetype : navigator.camera.picturesourcetype.camera, targetwidth : width, targetheight : height });
the width , height seems more related aspect ration picture's dimension.
Comments
Post a Comment