Site logo

[Resolved] Incorrect image warning for the logo on mobile device

Home Forums Support [Resolved] Incorrect image warning for the logo on mobile device

Home Forums Support Incorrect image warning for the logo on mobile device

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2518542
    Gilles

    Hello,
    While testing my site https://www.un-jardin-bio.com/ with PageSpeed Insights, for mobile devices, I got an Images displayed in the wrong format warning for my site’s logo (see here: https://i.imgur.com/Tz8JUDc.jpeg ).
    According to the test, the proportions are not the same between the original image and the one displayed on a mobile device… However, on my mobile device, these proportions seem correct!
    Maybe I made a change somewhere? But I can’t find where…
    Or is it the theme? Are adjustments possible?
    Thanks for your help.

    #2518718
    David
    Staff
    Customer Support

    Hi there,

    if you go to the media library, and select the Logo, what dimensions ( width and height ) does it show for that image ?

    #2518786
    Gilles

    Thank you for your reply.

    I just realized that there are different settings in the customization settings?
    So I uploaded new logos for each:
    – site identity: 230 x 56
    – layout / header / header for mobile: 164 x 40
    – fixed menu: 164 x 40
    But here is the result: https://i.imgur.com/h27xmxn.jpeg

    I probably don’t understand something… but what?

    #2519760
    David
    Staff
    Customer Support

    Are you using any plugins / functions that manipulate the image ?
    As this for example:

    <img width="170" height="58" class="header-image" src="https://www.un-jardin-bio.com/wp-content/uploads/2023/01/logo-blog-jardinier-bio-230x56-2.jpg" alt="Le Blog du Jardinier Bio" title="Le Blog du Jardinier Bio">

    the width="170" height="58" and height attributes don’t match those of the image.
    And that either means there is something odd with the image, or another function is changing those sizes.

    #2519803
    Gilles

    Ok… I had inserted this code, a long time ago, to not display this other page speed warning: Image elements do not have explicit width and height…

    /** Supression avertissement page speed : Les éléments d’image ne possèdent pas de width ni de height explicites*/
    add_filter( ‘generate_logo_output’,’tu_logo_atts’, 10, 2 );
    function tu_logo_atts( $output, $logo ) {
    printf(

    ‘,
    esc_url( apply_filters( ‘generate_logo_href’ , home_url( ‘/’ ) ) ),
    esc_attr( apply_filters( ‘generate_logo_title’, get_bloginfo( ‘name’, ‘display’ ) ) ),
    esc_url( apply_filters( ‘generate_logo’, $logo ) )
    );

    I deleted it…
    The incorrect format warning is gone… but not the “low res streamed images” warning (and I don’t want to put a logo as big as it says (328×80) on mobile… https://i.imgur.com/JtbuV09.jpeg

    #2519984
    David
    Staff
    Customer Support

    If you don’t want to increase the resolution of that image, then you will have to ignore that opportunity.

    #2520041
    Gilles

    ok, tkanks.

    #2520118
    David
    Staff
    Customer Support

    you’re welcome

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.