Problem with Taking pictures and upload to Parse

I create a test app to take a picture, upload to Parse and display on screen. The app work perfect but I have some problems:

  1. When I take the picture and the camera closes the app shows again but with a graphic error:

I notice that the error it gets fixed when I rotate the screen.

  1. In my code I put the target Width and Height (600px x 450px), but the image only respect the width. But the Height is proportional to the screen.

I take a picture that should be of 600px x 450px but the result image is 600px x 338px.

This is the image that is stored in Parse:

My code is:

        <App Theme="Basic" ClearColor="#eeeeeeff">
        <DockPanel>
            <StatusBarBackground DockPanel.Dock="Top" />
                  <JavaScript>
                      var Parse = require("Parse").Parse;
                    var Observable = require('FuseJS/Observable');
                    var Camera = require('FuseJS/Camera');
                    var Parse = require("Parse").Parse;
                    Parse.initialize("APP ID", "JAVASCRIPT ID"); 
                    var Post = Parse.Object.extend("fotos");

                    function MyFuction(args) {
                        Camera.takePicture({ targetWidth:600, targetHeight:450, correctOrientation:true }).then(function(file) {
                        module.exports.imageFile.value = file;
                          var newPost = new Post();
                          var parseFile = new Parse.File(file.name, file);
                          parseFile.save({success: function(){
                                      newPost.set("foto", parseFile);
                                    newPost.save();
                              }, error: function(){
                                      //
                              }
                            });
                        });
                      }

                    module.exports = {
                      MyFuction: MyFuction,
                      imageFile: Observable(null)
                    };

                  </JavaScript>
                  <JavaScript File="parse-1.5.0.min.js" ux:Global="Parse" />

                      <Panel  Background="Red" Width="100%" Height="80." >
                          <Text Alignment="VerticalCenter" Value="Take Picture and Upload to Parse!" TextColor="#fff" FontSize="20" TextAlignment="Center" />
                          <Clicked Handler="{MyFuction}" />                      </Panel>

                <Image File="{imageFile}" Width="100%" Height="100%" StretchMode="Uniform" />

        </DockPanel>
    </App>

Is it possible that these things do not happen?

Hi!

Problem 1) looks like a bug in our Android rendering. Can you please provide details of what device you are using for testing + steps to reproduce ?

Problem 2) is intentional. The size you ask the camera for is just a maximum size, the camera will return whatever aspect it natively captures.

Thanks!

  1. I testing in a Galaxy s4 (GT-I9505) Android 5.0.1. If you reproduce the code shown above and you take a picture, the graphic error appear when the image is displayed in the app:
module.exports.imageFile.value = file;

  1. Thanks!