bfintal / bfi_thumb

WP Image Resizer & a replacement for Timthumb. Extends and uses the default capabilities of WordPress' Image Editors to add some basic Timthumb capabilities.
http://bfintal.github.com/bfi_thumb/
GNU General Public License v3.0
206 stars 53 forks source link

Image Doesn't Crop When Of a Smaller Resolution than the params #29

Open alihs opened 9 years ago

alihs commented 9 years ago

I am using the new version 1.3 with Get the Image plugin Here is a snippet of my code

$masonry_grid_loop = new WP_Query($args);
$x = 0;  if($masonry_grid_loop->have_posts()): while ( $masonry_grid_loop->have_posts() ) : $masonry_grid_loop->the_post();

//check if we have images
$params = array( 'width' => 270, 'height' => 270, 'crop' => true );
if ( function_exists( 'get_the_image' )) {
    $image = get_the_image( array( 'image_scan' => true, 'format' => 'array', 'size' => 'full' ) );
    //resize image for full width stuff
}

<div class="item<?php $post_type = get_post_type(); if($post_type == 'case_study') { echo ' item2x'; } ?><?php if( ! empty ( $image ) ) { echo ' w-media'; }?>">
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

        <?php if( ! empty ( $image ) ) { ?>

        <div class="media">
            <a href="<?php the_permalink();?>"><img src="<?php echo bfi_thumb( $image[src], $params );?>" /></a>
        </div>

        <?php } ?>
    </div>
</div>

<?php $x++; endwhile; ?>

The image i am trying to upload is attached. Now when i remove the $params, bfi_thumb works perfectly else it doesn't. I think it is finding it hard to get the crop stuff for smaller images or am I doing something wrong?

untitled-1