3 Replies Latest reply on Nov 20, 2014 6:30 PM by Jon Tara

    choose_picture is down-scaling small images from photo roll!

    Jon Tara

      Note: this is in 2.2. Wondering if the same problem is still present in 4.1 or if other have encountered this? (Doesn't seem Camera API has changed in 4.1, but perhaps functionality has...)


      Our app gives users the choice of adding images from either the camera or the photo roll. We have a Preference in the app for desired resolution. The purpose is to limit image size depending on the user's networking situation, since the photos are ultimately uploaded to Dropbox.


      640x480, 800x600, 1024x768, 1280x1024, maximum


      Our default setting is 800x600.


      (Actually, we set the desired_width and desired_height to the max dimension shown in our drop-down, so it's actually:


        640, 800, 1024, 1280, maximum  )


      We pass this setting in Options to choose_picture and take_picture options_hash as desired_width, desired_height.


      So, I choose a test photo that is 1024x768. It comes in as 768x576. All well and good, since the original resolution exceeded the desired. And the aspect ratio was preserved, that's good too.


      Now, I choose a test photo that is 200x150. It comes in as 150x112. Why?


      It seems choose_picture is simply scaling photos to a percentage of max camera resolution?


      It sees to do this right, I have to call choose_picture twice. First, without specifying a desired width/height. Then, if the image is too big for the desired, discard the returned image, and choose_picture again, this time with desired_width and desired_height.


      Edit: No, that will not work! The user would be prompted to choose a photo again! It seems there is no solution to this. This needs to be fixed in Rhodes.