Image type auto detect for gif and mjpeg

What do you want to achieve?

SLS support for gif and mjpeg objects

Do you see alternative options and workaround to achieve it?

As a short term implementation without needing changes to the SLS UI I propose that any gif or mjpeg imported assets can be placed just as though they were png images with the first frame being displayed as a static image. Upon export the gif or mjpeg lib code is inserted automatically. Maybe allow just one gif object or mjpeg object per project to avoid the possibility of concurrent (but perhaps flagged invisible) animated objects sucking performance. Maintaining the ability to dynamically switch the ‘image source’ would be desirable tho.

Mention some use cases

Hi,

Currently we do not support GIF or MPEG playback. However, you can create an image sequence animation. You can find information about it in the dolumentum here:

Image frame animation - Can be used to show images after each other. The name of the images should start with the same file name but should end with a number indicating the index of the image in the sequence. SquareLine automatically recognizes these image sequences and they can be animated like any other property. The Start and End value tells from where to which image to play the animation.

You will also find an example of its use on the first screen of the new 3d printer 2 example project.

Yes I use animated image and it’s very good. But it’s also very easy to add gif playback to a SLS project with just a few lines of user code and the use_gif flag in lv_config.h

I thought therefore that it might be relatively easy for SLS to add a ‘Image is gif’ flag to the SLS image widget rather than defining a whole new gif widget. Just a thought.

Thanks for the suggestion, we’ll think about it