monkeyrunner - Android tool MonkeyImage does not support jpeg? -


i have written script in python using monkeyrunner:

image=device.takesnapshot() image.writetofile('filename.jpg','jpg') 

but have got null image this:

-rw-rw-r-- owner group 0 apr 14 21:56 filename.jpg 

when write

image.writetofile('filename.png','png') 

it worked well.i don't know why.

fortunately, adbclient communication method used androidviewclient/culebra interact android devices , emulators, supports saving images jpeg.

the basic script simple

#! /usr/bin/env python # -*- coding: utf-8 -*-  com.dtmilano.android.adb.adbclient import adbclient  adbclient('.*').takesnapshot().save('/tmp/image.jpg', 'jpeg') 

if interested in knowing more adbclient, why can save images jpeg or driving forces behind creation, there article understand, adbclient: under hood of androidviewclient/culebra.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -