Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 1.7.2, Release 2.1.0
    • Fix Version/s: Release 6.0.0
    • Component/s: iOS
    • Labels:
      None
    • Story Points:
      5
    • Sprint:
      2016 Sprint 15 SDK

      Description

      imageAsCropped seems to be rotating the image 90 degrees when applied.

      Before Crop: http://support-admin.appcelerator.com/files/cf1c121c-b9ae-11e0-8901-12313b1264a1/Before_crop.PNG
      After Crop: http://support-admin.appcelerator.com/files/cf110d22-b9ae-11e0-8901-12313b1264a1/After_crop.PNG

      Repro Code:

      var win = Ti.UI.createWindow();
      var currPic = null;
       
      var takePic = Ti.UI.createButton({
          zIndex: 1000,
          width: "90%",
          height: 40,
          title: "Take picture"
      });
      var imgView = null;
       
      takePic.addEventListener("click", function() {
          if (currPic !== null) {
              var croppedImg = currPic.imageAsCropped({
                  x: 0,
                  y: 0,
                  width: currPic.width,
                  height: currPic.height
              });
       
              imgView.image = croppedImg;
          } else {
              Ti.Media.requestCameraPermissions(takePhoto);
          }
      });
       
      win.add(takePic);
      win.open();
       
      function takePhoto(e) {
          if (!e.success) {
              Ti.API.error("No camera permissions granted");
              return;
          }
          
          Ti.Media.showCamera({
              success: function(event) {
       
                  takePic.title = "Crop image";
       
                  var image = event.media;
                  var width = image.width / 5;
                  var height = image.height / 5;
       
                  currPic = image;
       
                  imgView = Ti.UI.createImageView({
                      zIndex: 0,
                      width: width,
                      height: height,
                      image: image,
                      top: 40
                  });
       
                  win.add(imgView)
              },
              cancel: function() {},
              error: function(error) {},
              saveToPhotoGallery: false,
              mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]
          });
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apetkov Angel Petkov
                Reporter:
                aleard Alan Leard
                Reviewer:
                Hans Knöchel
                Tester:
                Abir Mukherjee
              • Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code