Hi!
As we’re running a tv-channel, all our images are HD (1.280 x 720p) and we see a lot of cropping going on in the different blocks.
Is it possible for us to change something so that the thumbnails of the blocks are not cropped, but resized ? If so, can we even do it without this change breaking every time you release an update for the template?
Hi,
The thumbs sizes are defined inside the functions.php file – http://screencast.com/t/NxiuYIwql9h
Also you can read here about the thumbs sizes (chapter 3) – https://forum.tagdiv.com/modules-and-blocks/
Thank you, Emil G.
Well, we’be been looking at it now and we’re confused.
We don’t need the cropping – it’s okay to resize, but not crop, as we particularly upload a 1280x720p image with borders etc.
Is it possible for us to let the template ONLY resize the width according to the pixels that fit and then let the image have the height in what ever fits the aspect ratio and with no cropping?
@livingsmarttv i have a plugin for you that going be ur best friend soon it’s called “Imsanity”
What this plugin do is resize any image to what you want on upload with out cropping etc and the sweet part it delete the original images after it resize ur image to what you choose in the settings..
Ex.Say you set the upload to post at 600 x 600 and ur image is 1014 x 483 what the plugin going too do when you upload that 1014 x 483 it’s going resize ur image to 600 x 600 and leave it at that,the size will not be change are cropp etc,but the link of this image have to be in ur text box when you making a post for it too work correctly…
You can find the plugin via wordpress @ url
http://wordpress.org/plugins/imsanity/
I’m using it as well and it save me from a lot of headaches lol
livingsmarttv,
Yes it is possible to not crop and only scale images. It gets a bit tricky with this theme though because it is set to crop every image(except the featured.)
In the functions.php file, you will find somewhere around line 320:
//featured image
$td_crop_features_image = td_util::get_option('tds_' . 'crop_features_image');
if ($td_crop_features_image == '') {
add_image_size('featured-image', 700, 0, true);
} else {
add_image_size('featured-image', 700, 357, true);
}
//the small thumbnails
set_post_thumbnail_size( 100, 65, true );
add_image_size('art-thumb', 100, 65, true);
//small height, 1 col wide
add_image_size('art-wide', 326, 159, true);
//medium height 1 col wide
add_image_size('art-big-1col', 326, 235, true);
//the slides
add_image_size('art-slide-small', 326, 406, true);
add_image_size('art-slide-med', 700, 357, true);
add_image_size('art-slide-big', 1074, 483, true);
//big slider - big image
add_image_size('art-slidebig-main', 745, 483, true);
//the gallery
add_image_size('art-gal', 210, 210, true);
Notice that TagDiv has built in the ability to turn cropping on or off on the featured image based on a setting in the theme panel, but you are asking for all of them.
add_image_size('featured-image', 700, 0, true);
In the line above, it is the ‘0’ argument that tells wordpress to adjust the height based on the aspect ratio of the image after it is scaled. To analyze the code a little more, what is happening with the ‘featured-image’ image size is that if them theme is not set to crop option then the ‘featured-image’ will be scaled to 700px wide and left to be however tall the image is. If you select the crop option, it will be scaled to 700px wide and then cropped to 357px tall.
You would need to look at which block(s) you are using and then determine which module the block is using to tell what image size it is. For example, let’s say your block uses td_module_2.php.
In that file, line 13 reads: <?php echo $this->get_image('art-big-1col'); ?>
If we look above at the functions.php entry, we see: add_image_size('art-big-1col', 326, 235, true); This means that if you upload a 1280×720 image, this will resize it’s width and crop it’s height to 235 pixels. If the scaled down image height is less than 235px tall, then it will scale the height to 235px and crop the width to 326px. This is not what you want. Rather, perhaps something like this: add_image_size('art-big-1col', 326, 0, false); This will take the image and scale to 326px wide and let the height be what it will be.
If you want make these changes so that updates to the theme will not break it, then you need to copy the image size declarations out of the theme’s functions.php file and put them in your child theme’s functions.php file and change the options. You might try something like this:
//featured image
$td_crop_features_image = td_util::get_option('tds_' . 'crop_features_image');
if ($td_crop_features_image == '') {
add_image_size('featured-image', 700, 0, false);
} else {
add_image_size('featured-image', 700, 357, false
}
//the small thumbnails
set_post_thumbnail_size( 100, 0, false );
add_image_size('art-thumb', 100, 0, false);
//small height, 1 col wide
add_image_size('art-wide', 326, 0, false);
//medium height 1 col wide
add_image_size('art-big-1col', 326, 0, false);
//the slides
add_image_size('art-slide-small', 326, 0, false);
add_image_size('art-slide-med', 700, 0, false);
add_image_size('art-slide-big', 1074, 0, false);
//big slider - big image
add_image_size('art-slidebig-main', 745, 0, false);
//the gallery
add_image_size('art-gal', 210, 0, false);
By setting all the height arguments to 0, we tell WordPress to always use the full height of an image relative to the horizontal scaling and by changing ‘true’ to ‘false’ we enable ‘soft crop mode’ vs ‘hard crop mode.’ Soft crop mode ensures your images will maintain their aspect and not have any cropping. Note, the 0 setting will make it so that any image uploaded that is not 16×9 aspect will be scaled and output at it’s own aspect ratio. This can break styling, but if you only upload 16×9 images it will be fine.
You would need to either re-build your current thumbnails or upload some new images to see if this fixes your problem(or creates others)
There are lots of gotchas here, and I certainly didn’t give you a definitive answer, but perhaps what I did say will help you figure out what combination of options will solve your problem.
Good luck!