Android PIL Crash
#1
Hey Folks

My addon works fine (and has done for years now) on Windows, Linux, OSX, etc. Even older versions of Kodi/Android.

However, there seems to be an issue with Kodi 17 and PIL on Android.

I've got a user reporting Kodi crashes and it's been isolated to OzWeather - the last line logged is:
21:37:18.774 T:18446744072311687656 DEBUG: Downloaded background texture...now converting from indexed to RGB - IDR.legend.0.png

Full log at:
https://www.dropbox.com/s/xbc6lauwsasy2en/kodi.log?dl=0

The code that follows this log line is:

Code:
im = Image.open( imageFileIndexed )
            rgbimg = im.convert('RGBA')
            rgbimg.save(imageFileRGB, "PNG")
            os.remove(imageFileIndexed)

And platform details are:

Code:
21:37:09.094 T:18446744072289448192  NOTICE: Starting Kodi (17.0 Git:20170201-a10c504). Platform: Android ARM 32-bit
21:37:09.094 T:18446744072289448192  NOTICE: Using Release Kodi x32 build
21:37:09.094 T:18446744072289448192  NOTICE: Kodi compiled Feb  1 2017 by GCC 4.9.0 for Android ARM 32-bit API level 21 (API level 21)
21:37:09.094 T:18446744072289448192  NOTICE: Running on amlogic MX MAX with Android 5.1.1 API level 22, kernel: Linux ARM 64-bit version 3.14.29
21:37:09.094 T:18446744072289448192  NOTICE: FFmpeg version/source: ffmpeg-3.1-kodi
21:37:09.094 T:18446744072289448192  NOTICE: Host CPU: AArch64 Processor rev 4 (aarch64), 4 cores available
21:37:09.094 T:18446744072289448192  NOTICE: Product: p200_2G, Device: p200_2G, Board: p200_2G - Manufacturer: amlogic, Brand: Android, Model: MX MAX, Hardware: amlogic

....Pretty sure this is a bug in Kodi/packaging, right? Could someone have a look please?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
there are known issues with pil(low) on android and windows.
so far, devs haven't been able to fix them.

until a fix is found, the use of it isn't recommended.
as a last resort, it's also been discussed to drop it from kodi.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Well...that would be far from ideal....

I can't really avoid using it if I need to convert an indexed to an RGB image right? As in, Kodi hasn't added support for that by any chance??
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#4
hey ronie,

Im the one having problems with this, but why only on my android tv box? ... i have mac OSX, windows 10 and a SONY android tv (5.1.1). they are all running roughly identical setups (kodi 17)but my tv box has a few extra addons. On the other units, kodi and oz weather are running without a glitch. The tv box was one of those stupidly fully loaded things, but i wiped everything with a restore and loaded kodi fresh. then only the repos and addons i wanted were loaded. So no crapware
Reply
#5
(2017-02-10, 01:17)bossanova808 Wrote: Well...that would be far from ideal....

I can't really avoid using it if I need to convert an indexed to an RGB image right? As in, Kodi hasn't added support for that by any chance??

nope.

perhaps you could try some online conversation tool:
http://www.cmyk2rgb.com/

or look for an alternative python library:
http://pymaging.readthedocs.io/en/latest/
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
These are radar overly images, generated every few mins, not static things, so I can't use an online service.

PIL remains (for now) the standard lib for python manipulating images in Kodi, right? If I bring in another lib won't that likely have just as many platform type issues?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#7
not likely, the problem with PIL is that it is partly written in C.
this is the reason why we ship it with kodi, as it needs to be compiled for each platform.
as far as i understand from the kodi devs, it is a nightmare to get PIL properly (cross)-compiled for every platform.

the alternative i was referring to is written purely in python.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
Ah right - ok, I will look in to that. Mean a small re-write but sounds like it would be worth it going forward.

That said, that lib hasn't been updated since 2013 so that's not ideal. But I'll look further into it, thanks for your help ronie
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
PIL Crash0