Yeah. You'll have to edit [b]i.php[/b].
Go down to line 205 which should be:
if ($cy === false) $cy = round(($newh - $ch) / 2);
Comment that line out by placing // before it so your end result should look like this:
//if ($cy === false) $cy = round(($newh - $ch) / 2);
Then just save it, clear your cache, and then reload the page.
can anybody help me with this? It says here - http://www.zenphoto.org/support/topic.php?id=562
that you can "Image sizing/cropping any way you want (for theme developers and/or users and/or plugin authors)" within v1.03
I looked at the stopdesign theme and saw this:
could anyone explain the variables used? I know the 210's are for height and width, but what about the 200 and nulls? I couldn't find any documentation concerning this...
basically what I want to achieve is thumbnails that are what ever height and width, but are cropped from the top downwards and not centered cropped?!
You are lookin for line 554 thru 560 of template-functions.php in the zen directory
printCustomAlbumThumbImage($alt, $size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=NULL, $cropy=null, $class=NULL, $id=NULL)
anychance you can breakdown the different parameters there on what each of them do, or give me a link to somewhere that does? =)
My problem is I want a set width and height cropped thumbnail but, when i set it most of the time faces are cut out of thumbs and you only see bodies. So i need to change the crop position so that its not so centered and more towards the top of each thumb/picture??!
I am sorry, I havent had any time outside of work to take a look into this to give you a better explaination. Take a look into the ThinkDreams theme or the Stopdesign theme as to where to get ideas for the thumbnail size and start playing around with it in the mean time. Otherwise I can see what I can dig up over the weekend.
You're going to have to go into your theme file and change all instances of printAlbumThumbImage / printThumbImage (or the like; I'm not looking at it right now) into printCustomAlbumThumbImage / printCustomThumbImage with the variables you need. So, like:
printCustomAlbumThumbImage('', 100, NULL, NULL, 80, 80, -1, 0, NULL, NULL)
will get you a 100-width image, cropped to 80x80, from the x-center/y-top (-1 means center-x, 0 means top-y).
So that's all done in the theme with that function. Let me know if you need any more help.
This is what Im trying to implement on my album.php page:
however when I try to view an album page I get an error message for the line that the custom cropped/sized thumbnail code is on, though im not getting any errors whilst using this (ie this custom sized/crpped code works):
on my index page that shows the individual albums??!!
It might not be the right function.... let me check...
Nope, it wasn't. Here's the right one:
printCustomSizedImage($alt, $size, $width, $height, $cropw, $croph, $cropx, $cropy, $class, $id)
We really need some good documentation on those template functions... I'll work on getting someone to do that.
Sorry to be pedantic about this, but Im trying to my theme just right
The previous and next image thumbnails on the image.php page are done differently then the other images in that there isn't a php code to call in the image rather the img source with the php for the next image thumbnail url. eg:
Looking at iphp I have know idea =)
Im guessing its this section that says:
// If s=thumb, Set up for the default thumbnail settings.
$size = $_GET['s'];
if ($size == "thumb") {
$thumb = true;
if ($thumb_crop) {
if ($thumb_crop_width > $thumb_size) $thumb_crop_width = $thumb_size;
if ($thumb_crop_height > $thumb_size) $thumb_crop_height = $thumb_size;
$cw = $thumb_crop_width;
$ch = $thumb_crop_height;
$crop = true;
} else {
$crop = $cw = $ch = false;
}
$size = round($thumb_size);
$quality = round($thumb_quality);
// Otherwise, populate the parameters from the URI
} else {
if ($size == "default") {
$size = $image_default_size;
} else if (empty($size) || !is_numeric($size)) {
$size = false; // 0 isn't a valid size anyway, so this is OK.
} else {
$size = round($size);
}
if (isset($_GET['w'])) { $width = round($_GET['w']); }
if (isset($_GET['h'])) { $height = round($_GET['h']); }
if (isset($_GET['cw'])) { $cw = round($_GET['cw']); $crop = true; }
if (isset($_GET['ch'])) { $ch = round($_GET['ch']); $crop = true; }
if (isset($_GET['cx'])) { $cx = round($_GET['cx']); }
if (isset($_GET['cy'])) { $cy = round($_GET['cy']); }
if (isset($_GET['q'])) { $quality = round($_GET['q']); }
}
$postfixstring = ($size ? "$size" : "") . ($width ? "_w$width" : "")
. ($height ? "_h$height" : "") . ($cw ? "_cw$cw" : "") . ($ch ? "_ch$ch" : "")
. (is_numeric($cx) ? "_cx$cx" : "") . (is_numeric($cy) ? "_cy$cy" : "");
} else {
// No image parameters specified; return the original image.
header("Location: " . PROTOCOL . "://" . $_SERVER['HTTP_HOST'] . WEBPATH
. "/albums/" . rawurlencode($album) . "/" . rawurlencode($image));
return;
}
though im not sure what to alter to make it customed cropped??
I've managed to alter this code (well, the way it is in the current version - the lines that set the value of $cy), but I'm still having trouble. What I'm finding is that this works when images are uploaded individually but not if they are uploaded via FTP.
Any suggestions? Is there another function somewhere that would be used for bulk uploads? I'll keep looking...