Hello
I wanted to ask if there is way to change properties of where coppermine should crop the thumbnails.
Like i always upload a pictures to my gallery, and mostly people heads are cut of the image, because it make the thumbnail from center.
So i wanted to ask if its possible to somehow set up, that when i Upload a picture, it will automatically crop the thumbnails from top or few pixels from top?
I hope you understand what i mean. If not i will post examples.
Thank you!
anyone??
picmgmnt.inc.php
find:
$crop=1;
switch ($CONFIG['thumb_method']){
for IMageMagick edit the lines below
case "im" :
for GD2 the lines below
default :
$xOffset and $yOffset are the relevant vars
Quote
default :
if($srcHeight < $srcWidth)
{
$ratio = (double)($srcHeight / $thb_height);
$cpyWidth = round($thb_width * $ratio);
if ($cpyWidth > $srcWidth)
{
$ratio = (double)($srcWidth / $thb_width);
$cpyWidth = $srcWidth;
$cpyHeight = round($thb_height * $ratio);
$xOffset = 0;
$yOffset = round(($srcHeight - $cpyHeight) / 2);
} else {
$cpyHeight = $srcHeight;
$xOffset = round(($srcWidth - $cpyWidth) / 2);
$yOffset = 0;
}
} else {
$ratio = (double)($srcWidth / $thb_width);
$cpyHeight = round($thb_height * $ratio);
if ($cpyHeight > $srcHeight)
{
$ratio = (double)($srcHeight / $thb_height);
$cpyHeight = $srcHeight;
$cpyWidth = round($thb_width * $ratio);
$xOffset = round(($srcWidth - $cpyWidth) / 2);
$yOffset = 0;
} else {
$cpyWidth = $srcWidth;
$xOffset = 0;
$yOffset = round(($srcHeight - $cpyHeight) / 2);
}
which ones of the bold ones should i change? i tried to change the 0 to whatever 1 2 7 -5 but nothing works. im lame to all this, can you tell me what should i change and what to put there when i want the thumbs to be cropped from the top of the images?
after
} else {
$ratio = (double)($srcWidth / $thb_width);
are the cases that handle cropping for pics with height < width
im sorry im total noob to this.
so what should i change height < width or offsety offsetx ?
i dont care about the width or height of the thumbnail right now (my sizes of thumbnails are okay for me). i just need to make the crop from the top of image not center. see the example attached
please help :(
$yOffset = round(($srcHeight - $cpyHeight) / 2);
change to (2 times)
$yOffset = 0;
should do (I guess)
thank youuu!!
it works :)
SOLVED.