[wp-trac] [WordPress Trac] #37730: Maybe image crop function problem on 4.6 version please check on function
WordPress Trac
noreply at wordpress.org
Fri Aug 19 05:44:28 UTC 2016
#37730: Maybe image crop function problem on 4.6 version please check on function
--------------------------+-----------------------------
Reporter: hmbashar | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 4.6
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
I have developed many theme and plugin and most of them are used WordPress
image crop function and it was working normally. But when I updated
WordPress version 4.6, The WordPress image crop function is not working
correctly in many of my plugin and theme. Example: when i gave
{{{#!php
<?php
add_image_size( 'cb_member_img', 300, 300 );
}}}
but when i upload images, then images are cropped as his wish, different
times different sizes. I have uploaded 5/6 images, the images width are
OK, But heights are different such as 241, 266, 214 etc. Here i uploaded
images which are sized in width and height were 2000px/1500px.
I have used this code:
{{{#!php
<?php
function cb_member_thum(){
add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails', array( 'cb-team-member' ) );
add_image_size( 'cb_member_img', 300, 300 );
}
add_action('after_setup_theme', 'cb_member_thum');
}}}
And calling function try:
{{{#!php
<?php
$cb_members_img = wp_get_attachment_image_src( get_post_thumbnail_id(
$post->ID ), 'cb_member_img' );
}}}
or
{{{#!php
<?php
the_post_thumbnail('cb_member_thum');
}}}
and get function.
I mention it again that it was working before, but after updating
WordPress 4.6, it was not working.
I think, it may be a problem in WordPress 4.6 image crop function. Please
check. If problem will be found, fix this then next version updated will
be released.
Thanks
Bashar
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37730>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list