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

Android: camera returns low resolution image using overlay

    Details

      Description

      The image returns by the camera is a low res image instead of the full size image on some devices when using an overlay.

      The galaxy nexus (4.1) returns an image of 320x240
      The ZTE N860 (2.3.5) returns an image of 640x480

      Samsung Galaxy S1 (2.3.3) is returning a full size image (2592x1944)

      Here is the code sample from bug TIMOB-8151 adapted to display image size.

      Ti.UI.setBackgroundColor('#ffffff');
       
      var homeWindow =    Titanium.UI.createWindow
      ({
       
      });
      homeWindow.open();
       
      var displayVoucherOverlayView   =   Ti.UI.createView
      ({
          top:        0,
          bottom:     0,
          left:       0,
          right:      0,
          opacity:    0.75
      });
      var setAButton  =   Ti.UI.createButton
      ({
          top:        100,
          left:       30,
          right:      30,
          height:     75,
          title:      "Click here to take a picture"
      });
      displayVoucherOverlayView.add(setAButton);
       
      setAButton.addEventListener('click', function() { Ti.Media.takePicture(); } 
      );
       
      var navigationBar =     Ti.UI.createView
      ({
          bottom:             0,
          height:             50,
          right:              0,
          backgroundColor:    "#000000",
          opacity:            0.75
      });
      var navBarTestBtn   =   Ti.UI.createView
      ({
          left:               5,
          width:              90,
          height:             50,
          top:                0,
          backgroundColor:    "#000000",
          borderColor:        "#FFFFFF",
          borderWidth:        2
      });
      var navBarTestBtnText   =   Ti.UI.createLabel
      ({
          width:              90,
          text:               "TEST",
          color:              "#FFFFFF",
          textAlign:          'center',
          font:               {fontSize:      10}
      });
      navBarTestBtn.add(navBarTestBtnText);
      navigationBar.add(navBarTestBtn);
       
      navBarTestBtn.addEventListener('click',   function() {alert("IM A VIEW WITH A LISTENER");} );
       
      displayVoucherOverlayView.add(navigationBar);
       
      var cameraTransform     =   Ti.UI.create2DMatrix();
      cameraTransform         =   cameraTransform.scale(2);
       
      Ti.Media.showCamera
      ({
          success:            function(event) {
          	Ti.API.info("Image dimension: " + event.media.width + "x" + event.media.height);
          	alert("Image dimension: " + event.media.width + "x" + event.media.height);
          },
          cancel:             function() {},
          error:              function(error) 
          {
              if (error.code == Ti.Media.NO_CAMERA) 
              {
                  alert("NO CAMERA");
              } 
              else 
              {
                  alert("CAMERA ERROR");
              }
          },
          mediaTypes:         [Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO],
          showControls:       false,
          autohide:           false,
          transform:          cameraTransform,
          overlay:            displayVoucherOverlayView
      });
      

        Attachments

          Activity

            People

            • Assignee:
              penrique Pedro Enrique (Inactive)
              Reporter:
              setphane_pinp Stephane Menard
              Reviewer:
              Hieu Pham
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-16673
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration