WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
$SIZES['40'] = '40x40px';$SIZES['50'] = '50x50px';$SIZES['60'] = '60x60px';$SIZES['75'] = '75x75px';$SIZES['100'] = '100x100px';$SIZES['125'] = '125x125px';$SIZES['150'] = '150x150px';
$SIZES['250'] = '250x250px';
$SIZES['40'] = '40x40px';$SIZES['50'] = '50x50px';$SIZES['60'] = '60x60px';$SIZES['75'] = '75x75px';$SIZES['100'] = '100x100px';$SIZES['125'] = '125x125px';$SIZES['150'] = '150x150px';$SIZES['182'] = '182x182px';
function make_thumb_png($source, $destination, $size) { // Check if GD is installed if (extension_loaded('gd') AND function_exists('imageCreateFromPng')) { // First figure out the size of the thumbnail list($original_x, $original_y) = getimagesize($source); $thumb_w = $size; $thumb_h = $original_y*($size/$original_x); /*if ($original_x > $original_y) { $thumb_w = $size; $thumb_h = $original_y*($size/$original_x); } if ($original_x < $original_y) { $thumb_w = $original_x*($size/$original_y); $thumb_h = $size; } if ($original_x == $original_y) { $thumb_w = $size; $thumb_h = $size; }*/ // Now make the thumbnail...
if you have a pic 1000 x 600 px and you change the THUMBNAIL-SIZE in Page-Settings to 150 x 150your thumb is 150 x 90
read my Example:Quoteif you have a pic 1000 x 600 px and you change the THUMBNAIL-SIZE in Page-Settings to 150 x 150your thumb is 150 x 90 if you need thumbs with 182 x 182, your big picture need the same lenght for width AND heightP.S. the file pngthumb.php builds only thumbnails from a big picture in png-Format.the real works make the file resize_img.php. you dont need to change something in this file if the big picture are with the same lenght for width and hight
Well if the image is 600x1000 and I set 182x182 thumbnails, I want it resized 182x303 .Should I change code in resize_img.php ?
else if ($orig_h > $new_max_h) { $new_h = $new_max_h; $new_w = intval($orig_w * ($new_h / $orig_h)); $resize = TRUE;}
// Resize PNG imagefunction resizePNG($source, $destination, $new_max_w, $new_max_h) { // Check if GD is installed if (extension_loaded('gd') AND function_exists('imagecreatefrompng')) { // First figure out the size of the image list($orig_w, $orig_h) = getimagesize($source); //Fix for fixed size width if ($orig_w > $new_max_w) { $new_w = $new_max_w; $new_h = intval($orig_h * ($new_w / $orig_w)); } else { // Image to small to be downsized echo "<div align='center'><p style='color: red;'>Image to small to be downsized!</p></div>"; return false; } ...}// Resize JPEG imagefunction resizeJPEG($source, $new_max_w, $new_max_h, $quality = 75) { if ($img = imagecreatefromjpeg($source)) { $orig_w = imagesx($img); $orig_h = imagesy($img); $resize = FALSE; $handle; //Fix for fixed size width if($orig_w > $new_max_w){ $new_w = $new_max_w; $new_h = intval($orig_h * ($new_w / $orig_w)); $resize = TRUE; } else { // Image cant be downsized echo "<div align='center'><p style='color: red;'>Image to small to be downsized!</p></div>"; return false; }...
if (!($fileext == "png")) { make_thumb($new_file, $thumb_destination, $resize);
if (!($fileext == "png")) { make_bakery_thumb($new_file, $thumb_destination, $resize);
function make_bakery_thumb($source, $destination, $size){ // Check if GD is installed if(extension_loaded('gd') && function_exists('imageCreateFromJpeg')) { // First figure out the size of the thumbnail list($original_x, $original_y) = getimagesize($source); if( $original_x >= $size ) { $thumb_w = $size; $thumb_h = $original_y*($size/$original_x); } else if ($original_x == $original_y) { $thumb_w = $size; $thumb_h = $size; } else { echo "<div align='center'><p style='color: red;'>Image too small to be downsized!</p></div>"; return false; } ...}