[TIMOB-25589] Not able to attach image in windows 10 app (SDK 6.3.0 GA)
GitHub Issue | n/a |
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 6.3.0 |
Fix Version/s | n/a |
Components | n/a |
Labels | windows10 |
Reporter | alka.gurung |
Assignee | Unknown |
Created | 2017-12-06T14:46:34.000+0000 |
Updated | 2019-06-26T18:07:31.000+0000 |
Description
Hi,
I really need you guys help.I am having a difficulty to attach image file on windows 10 App using SDK 6.3.0 GA. Application crashes whenever I try to attach an image from gallery. below is the chunk of code that I am using..
var SaveFileFromGallery = function(event)
{
try
{
imageOrVideo =0;
var cropRect = event.cropRect;
var image = event.media;
var mime_type = image.mimeType;
var SaveFile = function(e)
{
var f = Titanium.Filesystem.getFile(cDirTemp,fileName);
f.write(image);
Ti.API.info("before save");
imageView.image = f; //this line makes application crash
Ti.API.info("after save");
bDraft = true;
Ti.API.info("SaveFile fileexist" + f.exists());
};
setTimeout(SaveFile,500);
}
catch(ex)
{
alert("Error:" + ex.message);
}
};
var GetGallaryPhoto = function(e)
{
Titanium.Media.openPhotoGallery({mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO], success:function(events){SaveFileFromGallery(events);}, allowEditing:true});
};
Attachments
Hello, Please share a full reproducible code that can be copied into a project and be tested or compile a sample app and send the file in here. We will test and verify the issue. After that, we can move on fixing. Thanks.
Hi Sharif, I have attached a js file that I have used to test this functionality. When I select image from Gallery and tried to put selected image in imageview, it crashes the application. My requirement is 1. select image from gallery 2. Show it in imageview. Copy it to the temp folder 3. After pressing save button, copy that image to the real path. imageView.image = f; //This line makes application crash Hope to hear from you. Thanks Alka