Hi, I am needing to have images cropped on the fly based on what resolution the user needs. (it's for a wallpaper site.) Say I have an image that is 2560x1920 but I want to have a link to a widescreen version which would for example be something like 1280 x 800. I need to know what the code would be for this. For an example, I am currently using this `getCustomImageURL($size=1600)` code in the image.php file which outputs on the fly a 1600 x 1200 image from the original. This works fine as the ratio does not change from the original image.
So what I need to know is what to enter between the () that would crop the image to the dimensions I specify--essentially changing the aspect ratio of the image.
Also, I need to specify the offset of the crop so that it will crop an equal amount off the top and the bottom of the image so that I'd have a nice 16:10 widescreen aspect ratio.
Thanks in advance for any help you can provide.
Comments
The explaination of the parameters is found at the beginning of the i.php file.
Could you give me an example of the code I would need to resize a 2560 x 1920 image to 1280 x 800? I can't seem to get it to crop it both sides. I end up with it resized to the 1280 width but not 800 height.
This is the code I figured would work, but just changes the width: `<?php echo getCustomImageURL($cropw=1280, $croph=800);?>` Obviously it is not the correct code to use... what am I doing wrong? Thanks!
A good practice if you are new to something like this is to do a search on the zenphoto files for uses of the function to have examples of how things are used. This particular function is used in the effervescence+ theme. There is also `getCustomImage` which is a similar function and has the same parameters. It is used in effervescence+ and stopdesign.