Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1
    Join Date
    May 2011
    Posts
    2

    Default Image Lazy loading

    Does xara support (lazy loading) to help with page loading times? I would think this can be done in the image web Properties/Placeholder/HTML code (body) and or (head). What code is needed?

  2. #2
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,509

    Default Re: Image Lazy loading

    This would need to be done by inserting code with a placeholder, I think. I am not sure.

    A placeholder is a simple shape, a rectangle for example into which you add the code.

    Acorn or one of the other members will have a more specific answer.

  3. #3
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Lightbulb Re: Image Lazy loading

    These sorts of things are always churning through changes.

    The essence is as follows:
    1. Xara has yet to implement lazy loading.
    2. Browsers are becoming more compliant with the use of the attribute 'loading="lazy"' for images.
    3. There are workarounds.

    You would achieve this best with the later XDA versions that support Image Filenames & the WebP format.

    The approach would be to place all your lazy images on a lazy.htm page that ensures they are all uploaded as part of the website.
    lazy.htm is never accessed directly.
    Each image requires a unique filename, say, lazypicture.jpg.

    Drag and scale your image onto its webpage.
    In its Placeholder body, add code:
    <img src='index_htm_files/lazypicture.jpg' width=100% height=100% loading='lazy' />

    Although your design is showing the picture, it is not directly rendered.
    The code ensures it is not loaded into the page until you start scrolling.

    I find you always need a non-lazy image near the page bottom to stop the first lazy one loading right off.

    Here is a simple example: Browser Lazy Loading.xar

    To construct with earlier XDA versions, you may want to read the Thread https://www.talkgraphics.com/showthr...283#post623283.

    I think it is the right time for loading='lazy' to be an image attribute that Xara handles without all this fudging.

    Acorn
    Last edited by Acorn; 21 August 2022 at 02:32 PM.
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  4. #4
    Join Date
    Aug 2000
    Location
    Placitas, New Mexico, USA
    Posts
    41,509

    Default Re: Image Lazy loading

    I have moved this thread to Xara Web Design Chat.

  5. #5
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,921

    Default Re: Image Lazy loading

    I think it is the right time for loading='lazy' to be an image attribute that Xara handles without all this fudging.
    +1 in my opinion.

    I know your xar is only a demo but wouldn't it be better to create the images at actual size in the lazy.htm page? In your demo the images are loading at only a third of their full resolution.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Image Lazy loading

    @Egg, thanks for the endorsement.
    The pictures are full resolution of those on the lazy.htm page. These are 96dpi of the originals.
    The rendered ones that you can see are the same resolution of those.

    To get the fullest, original resolution, you would just have to rescale those on the lazy.htm page so to be their original sizes.
    @96dpi, the camel image is 4000x3000px; I just added the master images to fit the page as not doing so might have disturbed others accessing the file.
    This approach ignore Retina.

    Acorn
    Last edited by Acorn; 22 August 2022 at 11:20 AM.
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  7. #7
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Image Lazy loading

    I have created a very deep page with random images that lazy load as you scroll to the foot.
    Use F12 > Network to see the images load.
    The bottom Default is a click link to refresh to page and use a different random set.

    The Xara download is around 150kB.
    The images are a further 850kB and only during a scroll, one by one.

    Browser Lazy Loading into a Long Page.xar

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  8. #8
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,921

    Default Re: Image Lazy loading

    Loved that Acorn, it's a great asset. Messed about with your xar file and produced a site that doesn't load random images as yours does but in a practicle use why would you apart from your example of how it works. It works excellently with delayed loading images outside of the viewport. Very impressed.

    DEMO
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #9
    Join Date
    Apr 2024
    Posts
    1

    Default Re: Image Lazy loading

    This Thread started on 08/21/22 with: "These sorts of things are always churning through changes".
    Now almost 2 years later I would like to ask whether the information on this is still up to date?
    I was very pleased with Acorn's simple explanation of how to use it. I tried to answer the question with Google about what the XDA version is and whether I have it with my WebDesigner+.
    But I couldn't answer the question -.-

    My second question concerns lazy.htm
    In the example with lazy.htm, the rectangles with the codes in the placeholders are very far apart. Is that mandatory?
    Because if I put ALL of my lazy loaded images of the entire website into the lazy.htm, it will be a very, very long lazy.htm

  10. #10
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,839

    Default Re: Image Lazy loading

    Quote Originally Posted by Tessi View Post
    This Thread started on 08/21/22 with: "These sorts of things are always churning through changes".
    Now almost 2 years later I would like to ask whether the information on this is still up to date?
    I was very pleased with Acorn's simple explanation of how to use it. I tried to answer the question with Google about what the XDA version is and whether I have it with my WebDesigner+.
    But I couldn't answer the question -.-

    My second question concerns lazy.htm
    In the example with lazy.htm, the rectangles with the codes in the placeholders are very far apart. Is that mandatory?
    Because if I put ALL of my lazy loaded images of the entire website into the lazy.htm, it will be a very, very long lazy.htm
    Tessi, welcome to TalkGraphics.

    To find your version, open WD+ and pick Help > About...
    For me, I get "Xara Designer Pro+ 23.8.0.68981 SL x64 Apr 3 2024".

    Xara has yet to implement loading="lazy" as a user-selectable attribute.

    You stack and name your full size images in lazy.htm as you like.
    You can place them in Layers for better control but do ensure the layer name is preceded with a exclamation make (e.g., !layer05) so that the images are still published even when the layer is hidden.
    I stayed with JPEGs for simplicity but using WebPs would be better when you have 100s of images.

    The implementation where the loading="lazy" is used needs that page to be quite long so that those not is the immediate viewport are not fetched.
    In other words lazy load those below the fold. Ideal for SmartPhones as scrolling is an easy action to effect.
    Scrolling near a lazy image usually then loads that in around 10ms so no one really notices it appearing, it is just there.

    The concept is even more use when you have lots of YT videos. It works for IFRAMEs too.

    I have never tried it for images that have Xara Web Animations applied so it doesn't solve everything.

    Perhaps we should crowdnag Xara to implement it.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •