openhab / openhab-android

openHAB client for Android
https://play.google.com/store/apps/details?id=org.openhab.habdroid
Eclipse Public License 2.0
605 stars 315 forks source link

SVG in sitemap not displayed #3004

Closed jlaur closed 2 years ago

jlaur commented 2 years ago

Using the Bosch Indego binding I would like to see the map provided by channel gardenMap in a sitemap in the Android app.

Actual behaviour

Nothing is displayed.

Expected behaviour

SVG image should be displayed.

Steps to reproduce

Without the mentioned binding (including an Indego mower and account) it would need to be reproduced by creating an Image item and populating it with the attached content:

indego

The image is displayed correctly in Main UI as well as in the app through openHAB 3 UI side menu.

Items

Dimmer Indego_Mowed (Indego) ["Point"] { channel="boschindego:indego:lawnmower:mowed" }
Image Indego_GardenMap (Indego) ["Point"] { channel="boschindego:indego:lawnmower:gardenMap" }

Sitemap

sitemap indego label="Bosch Indego" {
        Text item=Indego_Mowed {
                Image item=Indego_GardenMap refresh=15000
        }
}

Environment data

Client

Server

Logs

App log

It seems that nothing is logged after trying to access the image by clicking the Text item.

openHAB Server log

Nothing is logged.

mueller-ma commented 2 years ago

The image is displayed correctly in Main UI as well as in the app through openHAB 3 UI side menu.

Main UI and the new openHAB 3 UI are the same. Did you test it with Basic UI in a browser on PC?

jlaur commented 2 years ago

The image is displayed correctly in Main UI as well as in the app through openHAB 3 UI side menu.

Main UI and the new openHAB 3 UI are the same. Did you test it with Basic UI in a browser on PC?

Yes, I believe it works correctly everywhere, except in sitemap shown in app.

mueller-ma commented 2 years ago

I added the following line to a sitemap and the image is shown correctly in the app: Image url="https://user-images.githubusercontent.com/19519842/184233510-1233df62-5828-4a79-bb8e-88b791b4e6e4.svg" It uses the image from this issue.

I thought this might be an issue in the svg rendering library, but it doesn't seem so.

jlaur commented 2 years ago

I added the following line to a sitemap and the image is shown correctly in the app: Image url="https://user-images.githubusercontent.com/19519842/184233510-1233df62-5828-4a79-bb8e-88b791b4e6e4.svg" It uses the image from this issue.

That works for me also, but it doesn't work when item is referenced through item:

And the same image is displayed/rendered correctly in Main UI. I can see that none of them works through Basic UI though. Item is raw type and mime type is "image/svg+xml".

mueller-ma commented 2 years ago

I can see that none of them works through Basic UI though

In that case I suggest to open an issue in the addon repo.