You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer:. I am very new to EFL and doubly so Python-EFL, but I had a program where I was trying to update the image data of an image control.
So I cobbled together some code that looked like this:
defupdateImage(self, imageControl, rgbaImage):
w, h=rgbaImage.sized=rgbaImage.tobytes()
evas_image=imageControlevas_image.image_size_set(w, h)
evas_image.image_data_set(d)
# Force the Evas image to reload and display the new dataevas_image.image_data_update_add(0, 0, w, h)
imageControl.show()
and the line evas_image.image_data_set(d) would throw and exception that would read:
ValueError: buffer size (1) is smaller than expected (7680000)!
So I dug into the code on github and in efl.evas_object_image.pxi, in the method .image_data_set() we see this code:
expected_size=_data_size_get(self.obj)
ifview.itemsize<expected_size:
raiseValueError(
"buffer size (%d) is smaller than expected (%d)!"% (
view.itemsize, expected_size
)
)
Where we see view.itemsize being compared against expected_size. However the documentation for itemsize says:
Item size in bytes of a single element.
Thus view.itemsize will always be smaller than the size of the whole buffer, and always throw an exception.
Now it's completely possible I am misunderstanding what you pass into to image_data_set(), but the documentation in not the most clear
The text was updated successfully, but these errors were encountered:
Disclaimer:. I am very new to EFL and doubly so Python-EFL, but I had a program where I was trying to update the image data of an image control.
So I cobbled together some code that looked like this:
and the line
evas_image.image_data_set(d)
would throw and exception that would read:ValueError: buffer size (1) is smaller than expected (7680000)!
So I dug into the code on github and in
efl.evas_object_image.pxi
, in the method.image_data_set()
we see this code:Where we see
view.itemsize
being compared againstexpected_size
. However the documentation foritemsize
says:Thus
view.itemsize
will always be smaller than the size of the whole buffer, and always throw an exception.Now it's completely possible I am misunderstanding what you pass into to
image_data_set()
, but the documentation in not the most clearThe text was updated successfully, but these errors were encountered: