• Is there support of AVIF images, or is it in the works? Any product thumbnail that is AVIF file type does not show up on the PDF. Thanks for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Jensen

    (@dkjensen)

    Hello

    I tested on my end with a .avif file and it was able to load fine. Let me ask a couple of questions:

    • Are you uploading a .avif file directly, or using a plugin or CDN to generate the .avif on the fly?
    • Have you tried excluding this .avif file from Cloudflare temporarily to see if there is perhaps an interference there?

    What I would start by trying, is having WC Cart PDF load the file from the server directly instead of over http to see if that helps. Could you paste this function in your child theme functions.php or in a snippet somewhere to see if that helps?

    /**
    * Replace image URLs with local paths in the cart PDF.
    *
    * @param string $content The cart PDF content.
    * @return string
    */
    add_filter( 'wc_cart_pdf_content', function( $content ) {
    $wp_upload_dir = wp_upload_dir();

    $content = str_replace( $wp_upload_dir['baseurl'], $wp_upload_dir['basedir'], $content );

    return $content;
    } );
    Plugin Author David Jensen

    (@dkjensen)

    I’m going to mark this as resolved but if this is not the case feel free to reach out again, thank you

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘AVIF Files Not Loading’ is closed to new replies.