SFOS fails to display some jpeg pictures

REPRODUCIBILITY (% or how often): 100%
BUILD ID = OS VERSION (Settings > About product): 3.3.0.16
HARDWARE (Jolla1, Tablet, XA2,…): jolla 1
UI LANGUAGE: english
REGRESSION: (compared to previous public release: Yes, No, ?): bug not present on 3.2.1.20

DESCRIPTION:

This picture:
https://jabber.de:5281/upload/TsnWniEyfopdXQCI/160555848520201015_194029.jpg

Can’t be viewed with by the qml ‘Image’ item.

STEPS TO REPRODUCE:

  1. download this picture to your local device
  2. create a simple qml app with a Image item and try to display this picture

EXPECTED RESULT:

picture is shown

ACTUAL RESULT:

the dimensions of the picture are ok.
the content of that picture is only black.

ADDITIONAL INFORMATION:

See the picture as an example. It was reduced in size by this code:

identify -regard-warnings -verbose
did not show any errors in this file

1 Like

Done, image showing in app on SDK emulator.

App running on Jolla1;
Screenshot_20201116_002

Strange. Here it get:
Error after glEGLImageTargetTexture2DOES 501

I just discovered this old thread:
https://irclogs.sailfishos.org/logs/%23sailfishos-porters/%23sailfishos-porters.2016-06-20.log.html
On this they stated maybe the image is to large.

I only tested the bug in the shmoose app. I will now also try the approach of a minimal qml app to check your result.

Indeed. The simple qml view works as expected also for me.

This qml code triggers the bug. The Image tag in line 121:

My Jolla1 test device (3.3.0.16) has this bug. Same code on my Xperia XA2 (3.2.1.20) works without any problems.

As I aleready asked/reported on TJC back in 2018:

https://together.jolla.com/question/179897/image-and-texture-size-limit/

The image/texture size is limited by the hardware and software. The Qt macro GL_MAX_TEXTURE_SIZE is intended to determine this limit but this seems to be not working on Sailfish OS (at least when I tested it back in 2018) and nobody was able to provide a solution in the TJC thread.

I still would like to know a proper solution for this. Such issues are just the reason why there are no proper apps being developed for SFOS.

1 Like

That`s interesting. Thank you! And the problem is somewhat more complex. As a ‘workaround’ I implemented an separate page to show images zoom-able and pitch-able, in contrast of showing the image between the chat text. On this separate page, the image is showing as expected. If the size limit triggers the bug you mentioned, it should not be shown on that separate page either? Or did I understand something wrong here?

Well it also could be another issue, maybe a bug of the corresponding QML component, I am just guessing here. But I had the same issue with the Jolla1 (back in 2018/2019) of pictures not being displayed… Nevertheless, the fact that it is working on other devices imply that it can not be a QML bug since all devices should have the same code base (at least in regards of the UI/QML components).
Does this issue occur just with big sized images or also with smaller ones?

It also could be a RAM issue, since the Jolla1 has limited memory (dependent of the internal implementation) that could mean that each process also receives a smaller memory chunk than on other devices.

Indeed, smaller pictures are getting displayed without a problem. So maybe it’s a combination of the bug and a RAM issue. The only real workaround here is to create and display thumbnails in the preview and displaying the full picture on a separate page.

Are you caching the pictures on the internal memory or are you just assigning the image URL to the QML component’s source property?
You could try whether caching the media files will workaround this issue.

I fetch the images to flash beforehand. Then I pass the local file storage path to the image source property. So it can’t be a network issue.

Here are some ideas for testing:

  • change “import QtQuick 2.0” to “import QtQuick 2.6
  • adjust some properties in Image {
    id: […]
    source: […]
    width: […]
    height: […]
    cache: false // useful when quickly change or load an image
    fillMode: Image.PreserveAspectFit // always keeps aspect ratio when resizing
    autoTransform: true // respect EXIF tags on rotation, useful for images taken with cameras
    sourceSize.width: (sourceSize.width > 1920) ? 1920 : sourceSize.width // limit the loaded image’s memory footprint size regardless of original size: IF sourceSize.width > 1920 pixels THEN set sourceSize.width to 1920 pixels ELSE just keep original sourceSize.width pixels
    sourceSize.height: (sourceSize.height > 1080) ? 1080 : sourceSize.height // or use same value as width -> 1920 pixels
    }

Hi

Thank you for the suggestion. It was worth a try, but didn’t do the trick. Bug still there…