autopy-legacy icon indicating copy to clipboard operation
autopy-legacy copied to clipboard

Clarify or better define bitmap to string and from string encoding

Open daluu opened this issue 9 years ago • 0 comments

bmp.to_string() and bitmap.Bitmap.from_string(string)

http://www.autopy.org/documentation/api-reference/bitmap.html https://github.com/msanders/autopy/#readme

The current documentation/tutorial doesn't make it clear to me. I had assumed the string is base 64. But trying out this tool/library and comparing to other base 64 encoding/decoding utilities output, the string produced by to_string() is not standard base 64 encoding.

I did come across one issue related to base 64 searching this Github project:

https://github.com/msanders/autopy/issues/9

Did I find some bug or is the string encoding not base 64 but some related variant? If a variant, why not use standard base 64? It would be nice to interoperate actions performed with AutoPy with other tools/utilties (e.g. decode output from AutoPy bitmap.to_string() elsewhere, encoded string elsewhere to load into AutoPy as bitmap). And if variant, is there a way to convert the to_string() value to standard base 64 and vice versa? So as not to need to do it separately/externally with some Python base 64 module.

FYI, I tested this with a PNG I saved externally with image editing tool that I loaded into AutoPy as well as a saved screenshot captured by AutoPy (saved with PNG extension), both on Windows 7 64-bit.

daluu avatar Dec 31 '14 00:12 daluu