← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #626490]: Errors happen when Android screen is horizontal

 

Question #626490 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/626490

    Status: Answered => Open

Action is still having a problem:
Hello, Sir, thank you for providing the solution. But unfortunately it's
not working.

     After I did some study on the codes of ADBDevice.java, I found it
uses adb command "screencap" to capture Android screen:

      InputStream stdout = device.executeShell("screencap");
      stdout.read(imagePrefix);

      And I think that's the reason of the error. Because the captured
image by "screencap" is always vertical even when the Android screen is
horizontal( at least on Android v4.4.4).

    And when these codes of ADBDevice.java compare the captured image to
Android screen, will trigger the error:

     if (byte2int(imagePrefix, 0, 4) != devW || byte2int(imagePrefix, 4, 4) != devH) {
        //TODO check orientation might have changed
        log(-1, "captureDeviceScreenMat: width or height differ from device values");
        return null;
      }  

    So I think the solution should be rotated the captured image 90
degrees to the left, instead of "return null;". Actually I try to write
some codes to fix this problem today, but I found it's totally beyond my
programimg ability. After all, I am just a software tester.

    So, still looking forward to fix the problem by you if you have enough time. Thanks again for sharing this amazing project to everyone for free.
    And if you need a software tester in this project, I hope I can help, for free, until i find a job.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.