Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25589] Not able to attach image in windows 10 app (SDK 6.3.0 GA)

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.3.0
Fix Version/sn/a
Componentsn/a
Labelswindows10
Reporteralka.gurung
AssigneeUnknown
Created2017-12-06T14:46:34.000+0000
Updated2019-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

FileDateSize
AddAttachments.js2017-12-07T15:25:20.000+00003864

Comments

  1. Sharif AbuDarda 2017-12-06

    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.
  2. alka.gurung 2017-12-07

    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

JSON Source