Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author stefanledin

    (@stefanledin)

    Hi Celso!
    No, I’m afraid that’s not possible at the moment. One solution might be to implement the ability to exclude image formats on the settings page.
    Would that be helpful?

    Thread Starter Celso Azevedo

    (@celsoazevedo)

    Hi Stefan,

    Yes, I think that’s a very good idea.

    Thanks for your help.

    Plugin Author stefanledin

    (@stefanledin)

    I’ll take a look at that during the weekend!

    Thread Starter Celso Azevedo

    (@celsoazevedo)

    Perfect! ??

    Thanks again.

    Plugin Author stefanledin

    (@stefanledin)

    Hi again! I’ve implemented a solution that I hope will work for you. If you wanna try it out and make sure it works before I ship it, you can download it here.

    Thread Starter Celso Azevedo

    (@celsoazevedo)

    Hi Stefan,

    Thanks for the changes! I have tested it on my blog and it works very well with the .gif format.

    I have also tested the .JPG option. It works with .jpg but not with .jpeg (yep, some people use the .jpeg extention…): https://files.ishr.co/2014/11/jpeg-vs-jpg.png . Maybe you should fix this before release it. ??

    Plugin Author stefanledin

    (@stefanledin)

    I actually did that after I’ve sent you the file ?? Try this.
    There’s a minor bug I’m gonna fix before I release this version. Expect it later today or tomorrow ??

    Thread Starter Celso Azevedo

    (@celsoazevedo)

    Perfect! ??

    Hi Stefan,

    Just tried to disable GIFs. Unfortunately they are not excluded. Does this apply even using echo Picture::create( 'element', $image["ID"], $rwp_attributes );?

    Thanks
    Aldo

    Plugin Author stefanledin

    (@stefanledin)

    Hi Aldo!
    Try this:

    <?php
    echo Picture::create( 'element', $image['ID'], array(
        'ignored_image_formats' => array( 'gif' )
    ) );
    ?>

    Hi Stefan

    Thanks for your quick feedback!
    Still no output. I get an empty tag:
    <picture ><!--[if IE 9]><video style="display: none;"><![endif]--><!--[if IE 9]></video><![endif]--><img srcset="" class="lazyload img-responsive"></picture>

    Plugin Author stefanledin

    (@stefanledin)

    Oh, that’s not right… ?? It kinda works, no src is returned, but nothing should be returned in that case.
    You could however do something like this:
    (I assume that you’re working with advanced custom fields)

    <?php
    $image_info = pathinfo($image['url']);
    if ( $image_info['extension'] != 'gif' ) {
    	echo Picture::create( 'element', $image['ID'] );
    }
    ?>

    I have not tried it myself, but something like that would work.

    Thanks for your example.
    I ended up filtering by mime_type and if there is a Gif I use the standard WP function.

    Cheers!
    Aldo

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Animated .GIFs’ is closed to new replies.