Member
Member
Joen   2009-03-27, 12:27
#1

Hello gents,

I'm trying desperately to find out how to use Zenphotos crop features rather manually.

The reason is, I've built a Wordpress plugin (http://noscope.com/journal/2009/01/zenphoto-shorttags-wordpress-plugin) which allows easy embed in any size of images in your gallery. The syntax is this:

[zenphoto src="image.jpg" album="album/subalbum" width="500"]

This all works fine and dandy, and it's really just a wrapper for i.php, for which the syntax is:

path/to/i.php?i=filename.jpg&a=album&s=size&w=width&h=height&cw=cropwidth&ch=cropheight&cx=cropx&cy=cropy

These parameters are documented in i.php as:

  • s - size (logical): Based on config, makes an image of "size s."
  • h - height (explicit): Image is always h pixels high, w is calculated.
  • w - width (explicit): Image is always w pixels wide, h is calculated.
  • cw - crop width: crops the image to cw pixels wide.
  • ch - crop height: crops the image to ch pixels high.
  • cx - crop x position: the x (horizontal) position of the crop area.
  • cy - crop y position: the y (vertical) position of the crop area.
  • q - JPEG quality (1-100): sets the quality of the resulting image.
  • t - Set for custom images if used as thumbs (no watermarking.)
    • cx and cy are measured from the top-left corner of the scaled image.
    • One of s, h, or w must be specified; the others are optional.
    • If more than one of s, h, or w are specified, s takes priority, then w+h:
    • If both w and h are given, the image is resized to shortest side, then
  • cropped on the remaining dimension. Image output will always be WxH.
    • If none of s, h, or w are specified, the original image is returned.

That brings me to my problem.

I can't for the life of me figure out which parameters to fill out, and which parameters not to fill out, to get the crop I want.

The situation is: I have a 625x124px image. That's the full size.

My blog has a maximum width of 600px in the width. So I want my image to fit. But I want it cropped, not scaled.

So, I want to fill in parameters so that I get a 600x124px image, with the 25 extra pixels chopped off the right side of the image. I do not want the image scaled either down or up.

So far I have:

i.php?&a=various&i=Gengo.jpg&w=600&cw=600&ch=124&cx=0&cy=0

but this seemingly creates a very much zoomed, upscaled crop. Very odd.

Any help is very much appreciated.

Member
Member
Joen   2009-03-27, 13:59
#2

I think I may have solved it.

http://noscope.com/photostream/zp-core/i.php?&a=various&i=Gengo.jpg&w=600&cw=600&ch=100&cx=1&cy=1

The above works.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.