Kivy Images

34 views
Skip to first unread message

hamid momeni

unread,
Sep 10, 2022, 12:37:14 PM9/10/22
to Kivy users support
Hello all
When I want to use "kivy.image.Image" to insert an "image.tif", I get an error.
How can I solve it, while I can insert image.jpg or .png images easily?

Elliot Garbus

unread,
Sep 10, 2022, 8:32:50 PM9/10/22
to kivy-...@googlegroups.com

What error are you seeing?  

The code below works for me:

 

from kivy.app import App
from kivy.lang import Builder

kv =
"""
BoxLayout:
    Image:
        source: 'board.tif'

"""


class TIFTestApp(App):
   
def build(self):
       
return Builder.load_string(kv)


TIFTestApp(). run()

 

 

What does the startup log look like?  What does it say for Image?  Could it be an install issue or a limitation of the platform you are running on?

 

[INFO   ] [Logger      ] Record log in C:\Users\ellio\.kivy\logs\kivy_22-09-10_7.txt

[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.3.3

[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.3.2

[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.3.1

[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.4.5

[INFO   ] [Kivy        ] v2.1.0

[INFO   ] [Kivy        ] Installed at "C:\Users\ellio\PycharmProjects\KivyHelp210\venv\lib\site-packages\kivy\__init__.py"

[INFO   ] [Python      ] v3.9.12 (tags/v3.9.12:b28265d, Mar 23 2022, 23:52:46) [MSC v.1929 64 bit (AMD64)]

[INFO   ] [Python      ] Interpreter at "C:\Users\ellio\PycharmProjects\KivyHelp210\venv\Scripts\python.exe"

[INFO   ] [Logger      ] Purge log fired. Processing...

[INFO   ] [Logger      ] Purge finished!

[INFO   ] [Factory     ] 189 symbols loaded

[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)

[INFO   ] [Window      ] Provider: sdl2

[INFO   ] [GL          ] Using the "OpenGL" graphics system

[INFO   ] [GL          ] GLEW initialization succeeded

[INFO   ] [GL          ] Backend used <glew>

[INFO   ] [GL          ] OpenGL version <b'4.6.0 NVIDIA 512.77'>

[INFO   ] [GL          ] OpenGL vendor <b'NVIDIA Corporation'>

[INFO   ] [GL          ] OpenGL renderer <b'NVIDIA GeForce RTX 2060/PCIe/SSE2'>

[INFO   ] [GL          ] OpenGL parsed version: 4, 6

[INFO   ] [GL          ] Shading version <b'4.60 NVIDIA'>

[INFO   ] [GL          ] Texture max size <32768>

[INFO   ] [GL          ] Texture max units <32>

[INFO   ] [Window      ] auto add sdl2 input provider

[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked

[INFO   ] [GL          ] NPOT texture support is available

[INFO   ] [Base        ] Start application main loop

[INFO   ] [Base        ] Leaving application in progress...

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/dd54e22d-c0ae-4531-b40b-4e15fc55fa17n%40googlegroups.com.

 

hamid momeni

unread,
Sep 11, 2022, 3:09:14 AM9/11/22
to kivy-...@googlegroups.com
This is my simple code
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.image import Image



class kivyApp(App):
def build(self):
img = Image(source = "livingroom.tif")
return img

kivyApp().run()

I'm using:
python : v3.7.9
kivy: v2.1.0
I get the errors below:
  • Unknown field with tag 34016 (0x84e0) encountered
  • Unknown field with tag 34017 (0x84e1) encountered
  • Unknown field with tag 34018 (0x84e2) encountered
  • Unknown field with tag 34019 (0x84e3) encountered
  • Unknown field with tag 34020 (0x84e4) encountered
  • Unknown field with tag 34021 (0x84e5) encountered
  • Unknown field with tag 34022 (0x84e6) encountered
  • Unknown field with tag 34023 (0x84e7) encountered
  • Unknown field with tag 34024 (0x84e8) encountered
  • Unknown field with tag 34025 (0x84e9) encountered
  • Unknown field with tag 34026 (0x84e10) encountered
  • Unknown field with tag 34027 (0x84e11) encountered
  • Unknown field with tag 34028 (0x84e12) encountered
  • Unknown field with tag 34029 (0x84e13) encountered
  • Unknown field with tag 34030 (0x84e14) encountered
and after some clicks on "Ok" for this error, I get the errors below:
  • SDL_image: Null count for "Tag 34022" (type 1, writecount -3, passcount 1)
  • SDL_image: Null count for "Tag 34025" (type 1, writecount -3, passcount 1)
  • SDL_image: Null count for "Tag 34026" (type 1, writecount -3, passcount 1)
then, after clicking on "Ok", the tif image will be shown.

‫‪Elliot Garbus‬‏ <‪elli...@cox.net‬‏> در تاریخ یکشنبه ۱۱ سپتامبر ۲۰۲۲ ساعت ۵:۰۲ نوشت:‬

Elliot Garbus

unread,
Sep 11, 2022, 3:35:24 PM9/11/22
to kivy-...@googlegroups.com

I don’t have a clue.  Is the image not a valid TIF file?

What does the startup log look like?  What does it say for Image?  What platform are you running on (Windows, Mac, Android, Raspberry Pi…)?

hamid momeni

unread,
Sep 11, 2022, 3:39:07 PM9/11/22
to kivy-...@googlegroups.com
I'm on windows and my startup is the same your. I want to try an 'image.tif'. 

Elliot Garbus

unread,
Sep 11, 2022, 4:00:14 PM9/11/22
to kivy-...@googlegroups.com

I have attached the tif file I used in my test.  This worked for me, I am also running Windows.

board.tif

Will Tejeda

unread,
Sep 11, 2022, 6:55:59 PM9/11/22
to kivy-...@googlegroups.com
Would it actually run without adding layout ? (I'm not on my computer and can't remember off the top of my head ) 

Elliot Garbus

unread,
Sep 11, 2022, 6:57:42 PM9/11/22
to kivy-...@googlegroups.com

Yes it will run with out the layout.

hamid momeni

unread,
Sep 12, 2022, 2:07:26 AM9/12/22
to kivy-...@googlegroups.com
Yes, you're right
But for the image that is attached, I get this error and for your Image It works very well.

‫‪Elliot Garbus‬‏ <‪elli...@cox.net‬‏> در تاریخ دوشنبه ۱۲ سپتامبر ۲۰۲۲ ساعت ۳:۲۷ نوشت:‬
livingroom.tif

Elliot Garbus

unread,
Sep 12, 2022, 9:09:14 AM9/12/22
to kivy-...@googlegroups.com

I get a similar error with the livingroom image.  It works fine if converted to a png.

Good Luck!

hamid momeni

unread,
Sep 12, 2022, 11:17:38 AM9/12/22
to kivy-...@googlegroups.com
Thanks a lot

‫‪Elliot Garbus‬‏ <‪elli...@cox.net‬‏> در تاریخ دوشنبه ۱۲ سپتامبر ۲۰۲۲ ساعت ۱۷:۳۹ نوشت:‬
Reply all
Reply to author
Forward
0 new messages