WebsiteBaker Support (2.8.x) > Bakery Shop
Bigger thumbnails
Kwb:
Hi there!
I'm trying to customize bakery for my website. Right now, I need to disable resizing of thumbnails or allow a bigger thumbnail size and size should be only on width.
Is that possible?
jacobi22:
modify_page_setting s.php at line 171 ff.
--- Code: ---$SIZES['40'] = '40x40px';
$SIZES['50'] = '50x50px';
$SIZES['60'] = '60x60px';
$SIZES['75'] = '75x75px';
$SIZES['100'] = '100x100px';
$SIZES['125'] = '125x125px';
$SIZES['150'] = '150x150px';
--- End code ---
build your own $SIZES behind the last line here, maybe
--- Code: ---$SIZES['250'] = '250x250px';
--- End code ---
for the Standard-Sizes, its works without coding, the 150 px are the max-width or max-height, not both.
for example: if you have a pic 1000 x 600 px and you change the THUMBNAIL-SIZE in Page-Settings to 150 x 150
your thumb is 150 x 90
[gelöscht durch Administrator]
Kwb:
Thx, it works! :-D
Kwb:
Is it possible to bind the resizing only to the width?
I did some manipulation to the code without success..
First of all I modified modify_page_settings.php and added my custom size (182 px).
--- Code: ---$SIZES['40'] = '40x40px';
$SIZES['50'] = '50x50px';
$SIZES['60'] = '60x60px';
$SIZES['75'] = '75x75px';
$SIZES['100'] = '100x100px';
$SIZES['125'] = '125x125px';
$SIZES['150'] = '150x150px';
$SIZES['182'] = '182x182px';
--- End code ---
And I set it as default in the page settings panel.
Then I tried to modify the file pngthumb.php:
--- Code: ---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
...
--- End code ---
I thought that in this way the resizing for thumbnails was just on width, but bakery keeps resizing on the biggest lenght ( either width or height )
jacobi22:
read my Example:
--- Quote ---if you have a pic 1000 x 600 px and you change the THUMBNAIL-SIZE in Page-Settings to 150 x 150
your thumb is 150 x 90
--- End quote ---
if you need thumbs with 182 x 182, your big picture need the same lenght for width AND height
P.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
Navigation
[0] Message Index
[#] Next page
Go to full version