Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. Sizes variable for full screen images

Sizes variable for full screen images

Scheduled Pinned Locked Moved Bug Reports
11 Posts 2 Posters 249 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    konrad
    wrote on Apr 19, 2024, 9:54 PM last edited by konrad Apr 19, 2024, 5:57 PM
    #1

    This might be related to this postbut I didn't wanted to hijack the thread

    Images set in a ways that they fill their container, like background images are displayed sometimes blurry. This stems from the way the "sizes" variable is calculated in JS. I am not a developer, but I suspect "sizes" is somehow derived from the parent container, then the next larger image size is selected.

    This behavior results in a bug for widescreen images that are displayed in a skinny browser window or on mobile. See this site on mobile / skinny tall browser; the size is set by the size of the container/ browser window but the image is scaled to fit resulting in a image width that is actually larger than the container and thus a too small and blurry image is displayed.

    Possibly the .naturalWidth function as opposed to the getboundingclientrect might help to get the actual size of the image.

    On our site we use background images quite often so it would be awesome to have a fix to it :-)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      arminunruh
      Global Moderator
      wrote on Apr 23, 2024, 4:12 PM last edited by
      #2

      a slim browser, 333px wide:

      Screenshot 2024-04-23 at 13.08.15.png

      the sizes attribute is set correctly:

      Screenshot 2024-04-23 at 13.08.23.png

      the image is loaded correctly:

      Screenshot 2024-04-23 at 13.09.39.png

      but yes it looks blurry!
      look at the image, i think the image itself is blurry:
      https://juengerkuehn.com/wp-content/uploads/JUENGERKUEHN/WEBSITE/sizes-4096x1651.png

      any chance you might be able to transform this image into an svg, i think illustrator or some other program had this feature where u can let it create an svg out of a normal image automatically

      for images like this that are mostly just black and white shapes, an svg will always produce the sharpest result with the least amount of data size

      1 Reply Last reply
      0
      • K Offline
        K Offline
        konrad
        wrote on Apr 24, 2024, 5:38 PM last edited by
        #3

        Hi Armin,

        I created the page just for illustration, the other images on the site are not in this vector style, so unfortunately svg is not an option.

        here is an example of an more typical image with the same effect.

        I am on windows and with the most recent version of laytheme and chrome I get the following result with a browser window 500x1000px:

        image.png

        The "sizes" variable does update based on the browser width: when I increase the width over 512px the next larger size (768px) is displayed,
        (of course once a larger version has been loaded once it always will display a higher res version so you have to "empty cache and hard reload")

        For widescreen images that are "cropped" by a skinny tall browser window or on mobile, "sizes" should be the natural width of the image not the container, I think :-)

        best konrad

        look at the image, i think the image itself is blurry:

        the image is uploaded as 4656x1752px and should be sharp

        1 Reply Last reply
        0
        • K Offline
          K Offline
          konrad
          wrote on Apr 25, 2024, 10:04 AM last edited by konrad Apr 25, 2024, 6:04 AM
          #4

          *forgot to include some images:
          the effect is same for mobile

          image.png

          image.png

          1 Reply Last reply
          0
          • A Offline
            A Offline
            arminunruh
            Global Moderator
            wrote on May 1, 2024, 9:23 PM last edited by
            #5

            oh yes

            i just digged deeper into my code and i see i mixed up the height and width at one point which results in a wrong calculation

            i will release a lay theme update in the next few hours, please let me know if that fixed it!

            1 Reply Last reply
            0
            • K Offline
              K Offline
              konrad
              wrote on May 3, 2024, 12:46 PM last edited by
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • A Offline
                A Offline
                arminunruh
                Global Moderator
                wrote on May 4, 2024, 3:10 PM last edited by
                #7

                yea sorry i didn't publish the update when i thought i did
                but now its published, can u try now?

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  konrad
                  wrote on May 5, 2024, 9:13 AM last edited by konrad May 5, 2024, 5:24 AM
                  #8

                  Hey, I updated the theme now, unfortunately the bug still persist:

                  ds17sUWAoz.jpg
                  here is a screenshot from the backend aswell; nowthing special: 100vh row and a background image, no custom css applied to the elements.
                  rUK8YzxNTS.jpg

                  Link to the original image: https://juengerkuehn.com/wp-content/uploads/JUENGERKUEHN/WEBSITE/KIM_0946-copy-1.jpg

                  EDIT: I tested also on mac 15" retina display with the same result:
                  Bildschirmfoto 2024-05-05 um 11.21.21.jpg

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    arminunruh
                    Global Moderator
                    wrote on May 8, 2024, 6:59 PM last edited by
                    #9

                    damn mmh

                    do u use a caching plugin, did u clear the cache?

                    can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      konrad
                      wrote on May 9, 2024, 9:03 AM last edited by
                      #10

                      Hi,

                      at the time no caching plugin was active, I've send you an email with a lengthy theory what might be going on, and an account to wp-admin

                      best

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        arminunruh
                        Global Moderator
                        wrote on May 17, 2024, 11:18 AM last edited by
                        #11

                        ok we managed to fix it

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        I also code custom websites or custom Lay features.
                        💿 Email me here: 💿
                        info@laytheme.com

                        Before you post:
                        1. When using a WordPress Cache plugin, disable it or clear your cache.
                        2. Update Lay Theme and all Lay Theme Addons
                        3. Disable all Plugins
                        4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                        This often solves issues you might run into

                        When you post:
                        1. Post a link to where the problem is
                        2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                        3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                        Online Users
                        S
                        Stanlouche
                        about a minute ago
                        benjaminmugnierB
                        benjaminmugnier
                        3 minutes ago
                        A
                        alasdair17
                        7 minutes ago
                        Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                        laytheme.com
                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Search