Question about load images

Stimulsoft Reports.JS discussion
Post Reply
robops
Posts: 10
Joined: Thu Dec 07, 2023 8:02 am

Question about load images

Post by robops »

Hello,I'm encountering some strange problems.
I made some report templates by Designer and render them by report&viewer.js.The templates may contain around dozens of pictures.In some of them,It works well,however,some of them render very slow.
I compared them carefully and found there exists different fuction call stack.I can't understand.
For the normal template,the function call as below.
Image
Image
Image
Image
I think these can indicate the correct render process.In the image tab of chrome inspect,the "convertAllImages" function call stack only called once or times equal to the number of pictures of first page.

And abnormal template shown as below.
Image
Image
Image
I wonder how the reason can cause the difference.
My sincerely.
Thank you.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Question about load images

Post by Lech Kulikowski »

Hello,

Please send us a sample project that reproduces the issue for analysis.

Thank you.
robops
Posts: 10
Joined: Thu Dec 07, 2023 8:02 am

Re: Question about load images

Post by robops »

Hello,here's the report template and data source.
https://webcc-pro.obs.cn-east-3.myhuawe ... 281%29.mrt
https://webcc-pro.obs.cn-east-3.myhuawe ... /data.json
Please try it with report.js.
Thank you.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Question about load images

Post by Lech Kulikowski »

Hello,

Thank you for the sample. We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Question about load images

Post by Lech Kulikowski »

Hello,

The convertAllImages function is called before each export to convert images to the desired format, e.g. pdf requires jpg.
Since viewer is basically an export to html, convertAllImages was also called, but after version 2023.2.3, when viewing a template in viewer, the convertAllImages call was removed (if you export to html, convertAllImages will still be called, since there is a choice of picture formats).

As for the long loading time, the given example contains 6MB of images and if you set the Continuous mode
the rendering will be as long. Images are loaded to get their width and height.
If you call export after all the images are loaded, the browser will give these images from the cache and there will be no re-loading.

Thank you.
Post Reply