+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Image Gallery Control Issue

Image Gallery Control Issue

7 posts, 0 answered
  1. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    26 Oct 2010
    Link to this post
    Hi,

    We have a Sitefinity website with a lot of pages and librairies (1500+). Almost a library per page. Those are custom libraries and we have only like 3-4 image libraries with a few images each.

    When Im editing a page to use the Image Gallery Control I have very long delays, when placing the control, edit it or saving my changes... More than a minute.

    Do you know of issues with this control or have an idea what could be wrong ?

    Thanks,

    Olivier
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    26 Oct 2010
    Link to this post
    Hello Olivier,

    The problem could be in the way that we bind the control that shows the libraries. We call GetAllLibraries method and it takes all libraries from the database. By default the ItemSelector uses page which value is set to 50 items per page. You could try to decrease this value to 10 items from

    Sitefinity\UserControls\Dialogs\ImageDialog.aspx

    <lib:ItemSelector runat="server" ID="test1" AllowPageSelection="true" ShowMode="Images"  ItemsPerPage="10" />


    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    29 Oct 2010
    Link to this post
    Thanks for your answer Ivan.

    But wouldnt the Images & Documents page be slow as well if the problem was the method ? It works fine and displays around 50 libraries easily on my website.

    And by the way, the control used to select the libraries seems to be the GallerySelector, if I take a look in ImageGalleryControlDesigner.ascx (and why is there a GalleryControlDesigner.ascx too ?) from the templates.

    Olivier
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    29 Oct 2010
    Link to this post
    Hello Olivier,

    I thought about the other control, so my previous reply is not related to ImageGallery control.

    GallerySelector is used by ImageGalleryDesigner. ImageGalleryDesigner is the control designer of ImageGallery control. GallerySelector works with a web service that is called when you open ImageGallery control for editing.

    The GallerySelector call a web service and it has a property LoadCount which sets the value for the items that will be loaded at a time. The default value is 20. You could try to decrease it to 10 from the GallerySelector declaration inside ImageGalleryControlDesigner.ascx external template.

    The web service is not called when you save the control, but it is called when you open it or you are switching between the tabs.

    Since we use a web service the problem could be somewhere else, so try to isolate the issue by using a new master page(template) and a theme without any controls on them. Inside the template crate a single ContentPlaceHolder. When you open the page drag-drop ImageGallery control and see whether you will experience the same issue.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    02 Nov 2010
    Link to this post
    Hi Ivan,

    I I tried the GallerySelector with a LoadCount to 10, in an external templated designer. The results were not better.

    In a blank template too, not better.

    Here's a few numbers, when I start with my blank page with blank template:

    Drag and drop the Image gallery control: ~1min 40
    Open edit dialog: ~1min 45, with Fiddler I can see the service LibrariesService.asmx being called, after CtrlProps, and its very fast.
    Saving in the designer dialog, without any modification: more than 3 min.
    Publish takes about 1 min 45 too.

    I get almost the same delays when I repeat edit and save.

    Same thing when I publish (without changing the gallery options) and come back to edit the page and then the gallery control.

    But when I finally select a specific image library (I have only one, with 3 images) in the designer and save, the edit control is fast enough, and the save control  and publish page now take ~50 seconds.

    Any idea what's going on ?

    Could I at least change the default settings to use the first image library, instead of all of them ?

    Thank you,

    Olivier
  6. Olivier
    Olivier avatar
    57 posts
    Registered:
    09 Jul 2010
    05 Nov 2010
    Link to this post
    Or any hint on how I could find where the slowdown comes from ?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Nov 2010
    Link to this post
    Hi Olivier,

    When you open the ImageGallery control and want to select from a library, the items are loaded on demand - 20 items per query. The problem is inside FilterExpression property of the control. It tries to filter the items by Parent ID and adds a coma delimited array of strings with IDs of all libraries you have.

    You can easily fix the issue by creating a custom control and override FilterExpression property of the control as shown below. I am returning an empty string, but you can create another public property and set the FilteEpxression property value to the value of your custom control in case you need to perform filtering

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using Telerik.Libraries.WebControls;
    using System.Web.UI.WebControls;
      
    /// <summary>
    /// Summary description for ImageGalleryCustom
    /// </summary>
    public class ImageGalleryCustom : ImageGallery
    {
      
        public override string ItemListTemplatePath
        {
            get
            {
                return "~/Sitefinity/ControlTemplates/Libraries/Modes/GalleryListView.ascx";
            }
        }
        public override string FilterExpression
        {
            get
            {
                return "";
            }
           
        }
        
    }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
7 posts, 0 answered