Problem with thumbnails

Created on 8 November 2024, 6 months ago

Problem/Motivation

GLightbox works perfectly, but the thumbnails, or any other option other than original size, are not displayed correctly.

Steps to reproduce

- Drupal 10.3.7
- Content type with image field

1
- GLightbox + original image: GLightbox works perfectly and the image is displayed correctly.
- GLIghtbox + thumbnail: GLightbox works perfectly, but the image is not displayed correctly.

2
- Image field: image with original size or thumbnail.
- View + GLightbox + thumbnail: GLightbox works perfectly, the preview of the view is displayed correctly, but the image in the view is not displayed correctly (https://www.gmpe.it/attivita).

I have tried all the combinations but, even if GLightbox always works perfectly, I can never display the thumbnail correctly.

What could this depend on?

Thanks and best regards

💬 Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

🇮🇹Italy giordy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @giordy
  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    Hi giordy, by default Glightbox gallery uses Thumbnail image style:
    /admin/config/media/image-styles
    /admin/config/media/image-styles/manage/thumbnail

    You need to update image effects or change image style in your View. Now your thumbnails are just small and resized to 100% width. For your case it will be better to create a new Image style "original image" without any image effects.

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    Ping me if you will have any questions.

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia
  • 🇮🇹Italy giordy

    Thanks for the quick reply.
    I must be doing something wrong because the view doesn't work.

    - I created the new style: original size, no effects.
    - In the content type I put: Image + original size.
    - In the view I put: GLightbox + thumbnail

    The preview is correct, but the view is not: https://www.gmpe.it/attivita.

    Thanks and best regards

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    > In the view I put: GLightbox + thumbnail

    Could, you share your Views settings screenshot please?

    I tested it locally and it's working fine with Views fields and teasers.

    You can update Thumbnail image style, if you display it full width, you shouldn't resize it to 100x100 pixels:
    admin/config/media/image-styles/manage/thumbnail?destination=/admin/config/media/image-styles

  • 🇮🇹Italy giordy

    Thank you for your patience.
    Attached when requested.

    Best regards

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    I see, you need to change 'Image style for content', now it's Miniatura (Thumbnail deafault style 100x100 pixels), but you need to set it Original image (without scaling or resizing). Then image will be full width and with good quality.

    As other option, you can use Thumbnail 100x100 pixels, but you will need to add extra CSS in your theme to make image 100px width.

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    It looks like you are already fixed it on your site. Cheers!

  • 🇮🇹Italy giordy

    The problem is that I want the thumbnail because the original image is too big.
    That's what I can't do.

    Thanks and best regards

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    You need to add piece of CSS code in your theme:

    Because all images are being displayed in full width in your theme now.

  • 🇮🇹Italy giordy

    Perfect, thank you. Now it works as I wanted.

    Thanks again and best regards

  • 🇮🇹Italy giordy

    Sorry to reopen the post, but I noticed that if I click on the image, all the others are also visible, but no gallery is set.
    How can I solve it?

    Thanks and kind regards

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    Hi giordy, by default GLightbox opens all images as one gallery if gallery options weren't set. You need to select option Gallery per post on Manage Display page for you content type, for example Article:
    /admin/structure/types/manage/article/display

  • 🇮🇹Italy giordy

    Thanks. I was used to Colorbox and I still have to get familiar with this module.

    Kind regards

Production build 0.71.5 2024