Pages (2): 1 2   
Member
Member
roraz   07-06-2006, 20:38
#1

Is there a way to change the crop position for thumbnails from centered? I would like my thumbnails that come from the larger pictures cropped so that its:

vertical - top
horizontal center

is there anyway to acheive this? I tried searching for an answer to no avail

Member
Member
DarrellD   07-06-2006, 21:32
#2

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.

Member
Member
roraz   12-06-2006, 19:54
#3

hi

I tried to do as you described but in the i.php file that i have, there is only 101 lines and no code like you described above.

Im using the zen photo files frm the version available from the front page 1.0.3

is there a way to do it with this version?

Member
Member
roraz   19-06-2006, 19:17
#4

anybody?

Member
Member
roraz   31-07-2006, 22:02
#5

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?!

Member
Member
Chilifrei64   31-07-2006, 23:29
#6

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)

Member
Member
roraz   01-08-2006, 15:30
#7

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??!

Member
Member
roraz   03-08-2006, 14:06
#8

anybody?

Member
Member
Chilifrei64   03-08-2006, 17:40
#9

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.

Member
Member
roraz   03-08-2006, 17:53
#10

cheers man - will do, any help would be appreciated

Developer
Developer
trisweb   06-08-2006, 17:46
#11

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.

Member
Member
roraz   08-08-2006, 12:55
#12

no man, thats great. I just needed a breakdown of each variable so I would know what to put in each to make it work right

cheers

Member
Member
roraz   14-08-2006, 23:21
#13

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??!!

Developer
Developer
trisweb   15-08-2006, 02:32
#14

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.

Member
Member
roraz   15-08-2006, 04:49
#15

cheers man that worked a treat

Member
Member
roraz   15-08-2006, 05:38
#16

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:

Developer
Developer
trisweb   15-08-2006, 19:01
#17

Yeah, if you just want to hack i.php to use custom crop info for the generic request, that might be much easier. Look at i.php and see if you can set cropy, that might be enough. I gtg, but lemme know if you need more help.

Member
Member
roraz   15-08-2006, 22:11
#18

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??

Member
Member
Megan   20-11-2007, 16:02
#19

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...

Administrator
Administrator
acrylian   20-11-2007, 17:36
#20

You can upload .zip-files with images.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.