Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27406

Android - Issue selecting large image from picker

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 8.0.0, Release 8.1.0, Release 8.2.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Titanium SDK : 8.1.0.GA - CLI 7.1.0 - Node version : 8.9.1 - Axway Appcelerator Studio, build: 5.1.2.201903111843 - Android 9

      Description

      I downloaded the following image to the device, so after that in the app I am selecting the image from the gallery of download, and it is causing a black/ gray window after selecting the image.

      http://www.effigis.com/wp-content/uploads/2015/02/Airbus_Pleiades_50cm_8bit_RGB_Yogyakarta.jpg

      The purpose of use this huge image it is that I am using the ti.imagefactory module to compress the image, but at the moment I am selecting the image downloaded the app is behaving in this way showing a black or gray window.

      Note this issue is not happening in iOS.

      XML:

      <Alloy>
      	<Window class="container">
      		<Label id="label" onClick="doClick">Hello, World</Label>
      		<ImageView id="mImageContainer" bottom="30"/>
      	</Window>
      </Alloy>
      

      JS:

      function doClick(e) {
      	alert($.label.text);
      	
      	Titanium.Media.openPhotoGallery({
      	        success:function(event)
      	        {	          
      	            if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
      	            		Ti.API.info("success");
      	            		$.mImageContainer.image = event.media;
      	            		
      	            }
      	        },
      	        cancel: function(e){
      	        		Ti.API.info(e);
      	        },
      	        error:function(e) {
      	        		Ti.API.info(e);
      	        },
      	        mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
          });
      	
      }
       
      $.index.open();
      
      

      [ERROR] TiExceptionHandler: (main) [15193,15193] Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=co
      ntent://com.android.providers.downloads.documents/document/raw:/storage/emulated/0/Download/x.jpg flg=0x1 }} to activity {com.tony.tony/or
      g.appcelerator.titanium.TiActivity}: java.lang.NumberFormatException: For input string: "raw:/storage/emulated/0/Download/x.jpg"
      [ERROR] TiExceptionHandler:
      [ERROR] TiExceptionHandler:     java.lang.Long.parseLong(Long.java:594)
      [ERROR] TiExceptionHandler:     java.lang.Long.valueOf(Long.java:808)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.io.TitaniumBlob.init(TitaniumBlob.java:89)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.io.TitaniumBlob.<init>(TitaniumBlob.java:41)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.io.TiFileFactory.createTitaniumFile(TiFileFactory.java:112)
      [ERROR] TiExceptionHandler:     ti.modules.titanium.media.MediaModule.createImageData(MediaModule.java:1276)
      [ERROR] TiExceptionHandler:     ti.modules.titanium.media.MediaModule.createDictForImage(MediaModule.java:1267)
      [ERROR] TiExceptionHandler:     ti.modules.titanium.media.MediaModule$1.onResult(MediaModule.java:1199)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.util.TiActivitySupportHelper$1.onResult(TiActivitySupportHelper.java:60)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.util.TiActivitySupportHelper.onActivityResult(TiActivitySupportHelper.java:117)
      [ERROR] TiExceptionHandler:     org.appcelerator.titanium.TiBaseActivity.onActivityResult(TiBaseActivity.java:905)
      [ERROR] TiExceptionHandler:     android.app.Activity.dispatchActivityResult(Activity.java:7797)
      [ERROR] TiExceptionHandler:     android.app.ActivityThread.deliverResults(ActivityThread.java:5071)
      [ERROR] TiExceptionHandler:     android.app.ActivityThread.handleSendResult(ActivityThread.java:5120)
      [ERROR] TiExceptionHandler:     android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
      [ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
      [ERROR] TiExceptionHandler:     android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
      [ERROR] TiExceptionHandler:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
      [ERROR] TiExceptionHandler:     android.os.Handler.dispatchMessage(Handler.java:112)
      [ERROR] TiExceptionHandler:     android.os.Looper.loop(Looper.java:216)
      [ERROR] TiExceptionHandler:     android.app.ActivityThread.main(ActivityThread.java:7625)
      [ERROR] TiExceptionHandler:     java.lang.reflect.Method.invoke(Native Method)
      [ERROR] TiExceptionHandler:     com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
      [ERROR] TiExceptionHandler:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
      

      Please let me know whether you have any doubt or question.

      Thanks, and best,
      Francisco Antonio Duran Ramirez.

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              antonioduran Francisco Antonio Duran Ramirez
            • Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code