Outputting wrong image size

Community Forums Forums General Discussion Outputting wrong image size

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  David Chu 1 year, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #58246

    johnsamwallace
    Participant
    Post count: 3

    I’m using Genesis 2.0.1 with a fairly basic custom theme.

    The following function outputs the correct size (‘home-featured’) image when the image uploaded is a .png or a .jpg. However, it outputs the full size image if the uploaded images is a .gif.

    function genesis_custom_post_image() {
    if ( $image = genesis_get_image( array( ‘format’ => ‘url’, ‘size’ => ‘home-featured’ ) ) ) {
    printf( ‘<div class=”logo”>%s</div>’, get_permalink(), $image, the_title_attribute( ‘echo=0′ ) );
    }
    }

    add_image_size( ‘home-featured’, 200, 100, false ); is in the functions.php file.

    Go to http://CaryLocal.org to see it. The entry with the .gif is Cary Move Management, LLC.

    Does anyone have a clue? I’m stumped. Thanks!

    http://carylocal.org
    #58274

    David Chu
    Participant
    Post count: 1371

    Hi,
    I believe this is a constraint of the GD image library, not WordPress. So rather than investigating and worrying, why not just edit the image, save as JPG or PNG, and boom, you’re ready to upload. :-)

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

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

You must be logged in to reply to this topic.