gnome-android-tool icon indicating copy to clipboard operation
gnome-android-tool copied to clipboard

Corrupted image

Open 5ulo opened this issue 7 years ago • 1 comments

Arch Linux (latest updates) Gnome Shell 3.24 Android 7.0

SED methot makes corrupted screenshot files on some linux distros. adb shell screencap -p | sed 's/\r$//' > screen.png The file was corrupted

$ exiftool screen2017-06-05-15\:56.png 
ExifTool Version Number         : 10.50
File Name                       : screen2017-06-05-15:56.png
Directory                       : .
File Size                       : 1565 kB
File Modification Date/Time     : 2017:06:05 15:56:55+02:00
File Access Date/Time           : 2017:06:05 15:56:53+02:00
File Inode Change Date/Time     : 2017:06:05 15:56:55+02:00
File Permissions                : rw-r--r--
Error                           : File format error

The perl method is more safer adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png On Android 7 adb shell screencap -p > ~/Desktop/screen.png

5ulo avatar Jun 05 '17 14:06 5ulo

's|\r\r$||' instead of 's/\r$//'

The perl method is more safer
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png 

If you use perl method then you would probably need perl installed on the system which might not be a big deal if I am guessing correctly.

On Android 7
adb shell screencap -p > ~/Desktop/screen.png

Is Screencap Android OS dependent?

sudhirkhanger avatar Mar 14 '21 03:03 sudhirkhanger