More in this section

Forums / Developing with Sitefinity / Ignore Proportions for Thumbnails

Ignore Proportions for Thumbnails

4 posts, 0 answered
  1. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    03 Mar 2010
    Link to this post
    Hi All,

    I am working on a gallery implementation for a sitefinity site.  I am using the image library as the container for my images but as a requirment that the thumbnails are 40x40.  I have updated the web.config to ensure the max hieght and width but the proportions still factor when uploading an image so is there a way of ignoring the the proportions for library uploads?

    Thanks,

    Rob
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Mar 2010
    Link to this post
    Hello Roberto Modica,

    You can control the default thumbnail size during upload by adding  defaultThumbnailWidth and defaultThumbnailHeight as shown below

    <libraries defaultGenericProvider="Libraries">
        <genericContentProviders>
            <add providerName="Libraries" publicationDateField="Publication_Date" defaultThumbnailWidth="40" defaultThumbnailHeight="40" />
     
     ...
                ....

    You can control the thumbnail size of ImageGallery control by setting ThumbnailMaxSize property.

    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.
  3. Roberto
    Roberto avatar
    146 posts
    Registered:
    08 Feb 2008
    03 Mar 2010
    Link to this post
    Hi Ivan,

    I have already changed the values in the web.config, but for instance regardless of the dimensions of my uploaded image, i want my thumbnail to be 40x40, and to ignore the constrain proportions, when i change the properties in the web.config it resizes and creates the thumbnails but it maintains the proportions so for instance creates and image 40x23, where i am trying to create equal size thumbnails.

    Thanks

    Rob
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Mar 2010
    Link to this post
    Hi Roberto Modica,

    Width Ratio and Height Ratio are managed in a static method ImagesHelper.GenerateThumbnail. This methods is used by UploadFile method of LibraryManager. Both methods cannot be overridden and the only solution that I see is new module with a custom method for uploading items.

    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.
Register for webinar
4 posts, 0 answered