U4-9950 - Media picker sidebar scroll very slow when many images in single folder

Created by Mark Owen 24 May 2017, 15:58:02 Updated by Mark Owen 25 May 2017, 11:04:53

What did you do?

  • Using Chrome went into the Umbraco back office
  • Opened the "Select media" sidebar by using a Media picker control.
  • Navigated to a folder with aprox 1000 images in
  • Scrolled through the images

What did you expect to happen?

  • The list to scroll at a reasonable rate

What actually happened?

  • The scroll was very slow (1 scroll point every few seconds)

On investigation I noticed an intimidate few issues that could be resolve in one way or another:

  • Images requested from the server are requested at width 500px despite never being displayed above 150px width
  • Displayed Image sizes appear to be being dictated by javascript leading the browser to need to resize images when rendering
  • All image elements are being loaded straight away. Some form of lazy loading would improve the situation

I also tried in a couple of other browsers and this issue presented worst, by far, in Chrome, but still wasn't great in others.

Comments

Mark Owen 25 May 2017, 10:33:50

It looks as if there are only 2 FileResolvers both that have the width of the image loaded hardcoded to 500. Feels like this should be parameterised. Since there are only 2 both with the same option I think it should be possible to change the signature of FileResolvers to (property, entity, thumbnail, width) with it falling back to width 500 if not set, but passed in in the case above to be smaller. One step in the right direction.


Mark Owen 25 May 2017, 11:04:53

Also as far as I can tell the entire function setOriginalSize in the MediaGridDirective is unrequired if the images were sized correctly when requested from the server. ImageProcessor supports width, height and a mode of max that will do what this method seems to do.


Priority: Normal

Type: Bug

State: Submitted

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.5.3

Due in version:

Sprint:

Story Points:

Cycle: