Change default cropping

Is there a way I can change the portion of the image which is shown in thumbnails by default?
I have the thumbnails the right size and everything, but let's say the image is 5120x1024, the thumbnail will only be taken from half of that by default, so I am having to go into the manual crop options for the images and drag it to fill the whole image.
I have Thumb Size set to 341 and then Crop Height and Crop Width set to 341 and 69, because I want the thumbnails to be 341x69 in the end. Is there something I'm not understanding?

Comments

  • Yes, it's easy to adjust it but you must edit the core file template-functions.php (this is mentioned in the online Documenation too, but there's not a lot of detail on how to adjust the functions and maybe that's because they don't want us messing with it if we don't know what we're doing, but that doesn't stop me as long as I have a backup copy.)

    On line 2705, you can assign values to the cropx and cropy, like this:
    $cropx=1, $cropy=1,

    I believe the absolute top-left of the photo is 0 and 0 but I wasn't sure and the numbers 1 and 1 seem to do the job. Because I wanted the top portion of my photos to show since they're mostly headshots.

    Here is a page that explains the X and Y axis:

    http://www.computerhope.com/jargon/x/xaxis.htm

    There are other values on that line 2705, but you'd have to research what they do.
    ($size, $width=NULL, $height=NULL, $cropw=NULL, $croph=NULL, $cropx=1, $cropy=1, $thumbStandin=false, $gray=false)

    So there are a lot of variables to work with, there.
  • You would be better off using a custom thumbnail function than modifying the core. Modifying the core is pretty well a guarentee of problems whenever we update zenphoto and it is almost never actually necessary.
Sign In or Register to comment.