Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Bitmap string conversion #9

Closed
usernamessuck opened this issue Jan 17, 2010 · 5 comments
Closed

Bitmap string conversion #9

usernamessuck opened this issue Jan 17, 2010 · 5 comments
Labels

Comments

@usernamessuck
Copy link

>>> a
<Bitmap object at 0x7f38d92c02d8>
>>> autopy.bitmap.Bitmap.from_string(a.to_string())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Could not create bitmap from string: Error decoding string
@msanders
Copy link
Collaborator

Could you please provide some more information for this? This example (with "a" replaced with a screen capture) works correctly on my current installation (Mac OS 10.5 with libpng and zlib).

@usernamessuck
Copy link
Author

64bit Linux, 2.6.32

The string used was 'b50,10,eNoz4Q1zl8gpNZ2/OvrW9vT7+/IeHSp6eLDwbrv7Uj/5fBPesHitumkB G7dnXNiWcT7TqB0oAkQZRu1L4vdvyTrX6DrfRy7XRy6n2HLSsrhDWzLP7i68fKDsxuGKm4fKbs6J3JqgUw9 U7yuX1+Q0f2X0sVTdVogJuFCMSsvi4Ev///+/dv4u0GGLQy5tSLy5I+PuruzbOzKu+crmAcWBsrvXHY9SrV oSerDWZk5FXN9/MFjQtyFNr31+yD5P6SygMiCaXLfUSjAmVbdtXujuNYnH1yWfWpd0MlqjGqgdYoWXdHaeY T9Q2X+8INa2ot1+C0SLm1jWHJ/Tq6Kubk6+uTn52rq4817SOXBXhSiUTXHZUmw4BdlVcaoNvY4bXMXTIcqA 4OP7L0BLvaVyS02mTffaPsNrB1Aj3FXuEpmZOt3EuKrFZgNEi4to5lTXI4uCLq6JubYm5vKysNMektlwVwV IF7eZrc5U70V2Vbhcdb3hUieRVLirIODkvkv+urmxio0Nhkt9JQrgrnITz+h33BStXAePLLhpQKfCBcMV6m d4QLU4i6T32++b63tmWdjl5eEXFgQcd5fIgrvKR6KgRmdxkkIHsquCJMvL1Oc5CqVAlAFNhjgACJ7cfwF0m J9IiZtgFtxVLqLpEx23T3La2We3rcVkbbxMB7KrgkSrS9WW1umv67DYDneVo1Baq+mWyc6HZnufAqIpLgdc xTLhrvISzS9RmRcr3YrsKn/RkgKFmQ6CyXBXOfFltObNAsYjJDaBceHAnQZ3Fdjj2yc775ngsLvNbFOiXDe yqwJFq0tUl9TorO6y2jnT6yREi71ASqXWSqDDemx2d1vvajPb6iScDneVh3BuvvzsaIlmZFf5Chfnyk63F0 C4yl+o1EeoGOgYuMOAIQZ3lZNwWp/dzikuByc5Hei03JGs0IsWViUqi4Fh1W2zexbMVXb8SXlyc8vVl9Xpr a3VXVOpucJBMBXuKneh3FzZ2ZHimK6a4SCAiMFQieoipbmBYuVwhwGlkF3Va7tnmtvRKS6HgR5PVepHdlWw eE2FxvImo419dntn+5yGaLHlS0yXmA50WKHiAiDKlZ1jx58Md5WrYE6W1Mxw0SZkVwGDJVt6JrKrImUaa3R WVmktDxKvzPJrRs4C4ESSCowLoMOACMhIVuxDdlWoRC0wKJpNNk9w2D8H5iqsBRrCVQLZGRLTw0UakV3lLV gMdCqyq+IU24FR32KyGZg8vEWKgWqQXQUM/GbjTcAUAkQ4XWW8qd9hPzBhAwCprWs+'

@behrisch
Copy link

I can confirm this, the error occurs with every png I try.
My system is openSUSE 11.1 (32bit) with
Python 2.6 (r26:66714, Mar 30 2010, 00:30:21)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2

@msanders
Copy link
Collaborator

I believe this has been fixed, as the above string now makes a bitmap without an exception: http://pastie.org/1933755

@msanders
Copy link
Collaborator

Nevermind. Apparently this bug is due to the base64 decode function in autopy failing when the string contains any trailing whitespace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants