ZenphotoCMS Forum
custom sized random image - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: custom sized random image (/thread-2281.html)



custom sized random image - albeezie - 2008-10-12

I tried to do it on my own but I got all messed up..

I would like a full size, uncropped random image at a certain size, such as is done in the printCustomSizedImageMaxSpace..

I know I could take a random image and have it show up, but some of my pictures are portrait, others are landscape style, and getCustomImage just doesn't cut it. Any tips?




custom sized random image - olihar - 2008-10-12

are you sure

`

`
does not work for you?

640px is the size for both sides in example, just to make sure you get that.




custom sized random image - albeezie - 2008-10-12

That works for a specific image if the image (such as the main image showing on image.php) is called. It does not seem to work for random images, at least not in my tests.




custom sized random image - acrylian - 2008-10-12

Please take a close look at the getCustomImage() functions. You can set cropping in it's options.




custom sized random image - albeezie - 2008-10-12

hey acrylian,
I would like an uncropped random image showing up.. I know how to crop with getcustomimage. at first I used it with width 230 and height 230 but this automatically cropped my portrait style photos where height > width




custom sized random image - acrylian - 2008-10-12

To get an uncropped image you should only set either size or only width or height. If you set width and height you get always an cropped image.




custom sized random image - albeezie - 2008-10-12

For example, some of my pictures are 600x400 and some others are 400x600, which is why I wanted the max space fxn.. Guess I can just make my own function.




custom sized random image - albeezie - 2008-10-13

Ok, I wrote my own function to do what I wanted.

--- edit -- I wrote something else here but I figured it out so no worries.