<?php 
/**
 * Deus image sizes
**/ 
?>
<?php

// Register Thumbnails


$ds_site_width = get_option('t1t_site_width');
$ratio = 1350;
$ratio = $ds_site_width;

//300 * 180

$width25thumb = round(((($ratio - 30) / 4 ) - 30 ) / 4);
$width25 = round((($ratio - 30) * 0.25 ) - 30 );
$jumping_thumb = round(($ratio - 30) * 0.25 );
$width40 = round(((($ratio - 30) * 0.25 ) - 60) * 0.40);
$width50 = round((($ratio - 30) * 0.5 ) - 30 );
$width75 = round((($ratio - 30) * 0.75 ) - 30 );
$width100 = round( $ratio - 60 );




// Register Thumbnails

if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
//thumbnails
add_image_size( 'small-thumb', $width25thumb, $width25thumb, true );
//big-featured-images
add_image_size( 'image-featured', $width25, round($width25 / 0.907), true );
//small-featured-images
add_image_size( 'small-image-featured', $width25, round((($width25 / 0.907) / 2) - 15), true );
//blogroll1
add_image_size( 'small-blog', $width25, round($width25 / 1.666), true );
//blogroll2
add_image_size( 'big-blog-one', $width25, round($width25 / 2.776), true );
add_image_size( 'big-blog-two', $width50, round($width50 / 2.776) , true );
add_image_size( 'big-blog-three', $width75, round($width75 / 2.776), true );
add_image_size( 'big-blog-four', $width100, round($width100 / 2.776), true );
//super-slider
add_image_size( 'super-slider-high', 634, 460, true );
add_image_size( 'super-slider-short', 634, 230, true );
//slider
add_image_size( 'slider-two', $width50, round($width50 / 1.909) , true );
add_image_size( 'slider-three', $width75, round($width75 / 2), true );
add_image_size( 'slider-four', $width100, round($width100 / 2), true );
//carousel
add_image_size( 'big-carousel-thumb', $width25, round($width25 / 0.538), true );
//tw-widget
add_image_size( 'tv-widget-thumb', $width40, $width40, true );

//jumping-posts
add_image_size( 'jumping-posts-thumb', $jumping_thumb, round($jumping_thumb / 1.45), true );

//review
add_image_size( 'review-img', round(((($ratio - 30) * 0.75 ) - 30)* 0.25), round(((($ratio - 30) * 0.75 ) - 30)* 0.25) / 1.33, true );

}




//Woocommerce thumbnails dimensions
function catalog_woocommerce_image() {
	$ds_site_width = get_option('t1t_site_width');
	$ratio = 1350;
	$ratio = $ds_site_width;
	$woocatalog = round(((($ratio - 30) * 0.75 ) - 30)* 0.22);
  	$catalog = array(
		'width' 	=> $woocatalog,	// px
		'height'	=> $woocatalog,	// px
		'crop'		=> 1 		// true
	);
	return $catalog;
}
function single_woocommerce_image() {
	$ds_site_width = get_option('t1t_site_width');
	$ratio = 1350;
	$ratio = $ds_site_width;
	$woosingle = round(((($ratio - 30) * 0.75 ) - 30)* 0.48);
	$single = array(
		'width' 	=> $woosingle,	// px
		'height'	=> $woosingle,	// px
		'crop'		=> 1 		// true
	);
	return $single;
}
function thumbnail_woocommerce_image() {
	$ds_site_width = get_option('t1t_site_width');
	$ratio = 1350;
	$ratio = $ds_site_width;
	$woothumb = round(((($ratio - 30) * 0.25 ) - 30)* 0.25);
	$thumbnail = array(
		'width' 	=> $woothumb,	// px
		'height'	=> $woothumb,	// px
		'crop'		=> 0 		// false
	);
	return $thumbnail;
}
add_filter( 'woocommerce_get_image_size_shop_catalog', 'catalog_woocommerce_image' );
add_filter( 'woocommerce_get_image_size_shop_single', 'single_woocommerce_image' );
add_filter( 'woocommerce_get_image_size_shop_thumbnail', 'thumbnail_woocommerce_image' );




?>