Support » Plugin: WordPress Gallery MaxGalleria » Proportional thumbnails?

  • Resolved altimac

    (@altimac)


    Hi, wondering if there is a way to have the thumbnails display in a proportional way. If I choose the square option the tops of the images are cut off, but if I use the portrait option, the left and right edges are cropped off. Is there any way to show each thumbnail in a way that preserves each image’s aspect ratio? Thanks for any insight you can provide. This is a pretty awesome plugin BTW.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author AlanP57

    (@alanp57)

    MaxGalleria calculates the size of image to use based on the number of columns that are displayed in the gallery and the shape. Plus there is a filter available that can be used to modify the size of a thumbnail via a function. How many columns are you using in your galley and what width and height of thumbnail would be ideal for your gallery?

    Thread Starter altimac

    (@altimac)

    Hi, Alan and thanks fro your response. What I am trying to achieve is to have the gallery display the images with their width and height intact and all set to the same width, so that nothing is “chopped off” from the left and right of the images. That would mean that the thumbnails are all shown at the same width but at varying heights, which would be fine if that is possible. Here is an example on my site, I have five columns but would like to not have the left and right edges of the images sliced off:

    http://erbachcom.com/wordpress/#our-work

    Images #2 and #3 have their left and right edges sliced off, whereas image #10 has the bottom of the image sliced off. Again not sure if there is a way around this but just figured I would inquire.

    Plugin Author AlanP57

    (@alanp57)

    Well, MaxGallery works better when the images you add to the gallery have a uniform size and width. Now in this case you could add images that will display thumbnails all the same size, and in the gallery options, set ‘Thumbnail Click Opens’ to ‘Open link in lightbox’ and then for each image, set the image link to display a full size image rather than the image in the gallery. To set an image link different that the gallery image, in the gallery page image tab, hold the mouse pointer over the image and four links will appear. Click the Edit link. There you can enter an alternate link to display.

    Now also there is a filter built in to MaxGallery that allows you to modify the size of the thumbnail by adding a function to your theme’s functions.php file. You can try using this and see if it will help with my suggesting above. The size of image you need for your thumbnail is 163×243 pixels.

    Here is the function that allows you to specify that size of the thumbnail you need:

    add_filter('maxgalleria_thumb_size_portrait_five_column', 'thumb_size_portrait_five_column', 10, 1);
    
    function thumb_size_portrait_five_column($thumb_size) {
      return array('width' => '163', 'height' => '243')); 
    }

    You can add this to your theme’s functions.php file.

    • This reply was modified 4 years, 4 months ago by AlanP57.
    • This reply was modified 4 years, 4 months ago by AlanP57.
    Thread Starter altimac

    (@altimac)

    This is great, Alan. Thank you so much for your help with this and I will give that a shot. Again, thanks!

    Thread Starter altimac

    (@altimac)

    Hey, Alan, just FYI, I noticed that “maxgalleria-hooks.php” has a bunch of typos for the PORTRAIT thumbnail filters, they are in there as

    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_ONE_COLUMN’, ‘maxgalleria_thumb_size_portait_one_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_TWO_COLUMN’, ‘maxgalleria_thumb_size_portait_two_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_THREE_COLUMN’, ‘maxgalleria_thumb_size_portait_three_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_FOUR_COLUMN’, ‘maxgalleria_thumb_size_portait_four_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_FIVE_COLUMN’, ‘maxgalleria_thumb_size_portait_five_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_SIX_COLUMN’, ‘maxgalleria_thumb_size_portait_six_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_SEVEN_COLUMN’, ‘maxgalleria_thumb_size_portait_seven_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_EIGHT_COLUMN’, ‘maxgalleria_thumb_size_portait_eight_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_NINE_COLUMN’, ‘maxgalleria_thumb_size_portait_nine_column’);
    define(‘MAXGALLERIA_FILTER_THUMB_SIZE_PORTRAIT_TEN_COLUMN’, ‘maxgalleria_thumb_size_portait_ten_column’);

    So the “thumb_size_portait” should be “thumb_size_portrait” I assume…

    Plugin Author AlanP57

    (@alanp57)

    Maybe it should, but if someone is using the filter, correcting the typo would break their code. We’ll leave it as is.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Proportional thumbnails?’ is closed to new replies.