![]() |
|
Option to crop longer side of thumb - 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: Option to crop longer side of thumb (/thread-1286.html) |
Option to crop longer side of thumb - slideshowbob - 2007-03-15 Hi, I was wondering if it's possible to crop only the longer side of a thumb to a specific length after resizing. For e.g. if I have a panoramic picture that is 2048x768 in size, and I specify a thumb size of 85 in the config. The pic would get resized to 227x85. So far so good. But in my gallery, I don't want thumnbails that are more than 130px wide or tall. Now, I can't specify a crop size of 130 in the config because that's not what the property's used for. Hence, I wonder if such functionality is possible or will be included in zenphoto? Thanks. Option to crop longer side of thumb - trisweb - 2007-03-15 You can modify the theme to do that -- just change the image functions into their 'custom' equivalents and you have full control over sizes and crops. Take a look at the included Stoppeddesign theme to see how that's done. Option to crop longer side of thumb - slideshowbob - 2007-03-15 Thanks for your prompt reply! Option to crop longer side of thumb - ZeBoxx - 2009-08-09 old, old thread - but as it's on the same topic... I made a function to do a "fitFromOutside" type scaling of an image to a given rect. This basically scales down an image until either of its opposing edges touches the matching edges of the rect I want it to fit. ( the 'max space' functions, I believe, are equivalent to "fitFromInside" ) This means that there's often extra space left which needs to be chopped off. Using getCustomImage() seems like it should do the trick, but this code... What am I missing? Probably something simple, but the documentation for the getCustomImage method in the Image class is fairly bare. e.g. it doesn't specify behaviors . I peeked at the code and it certainly -seems- like it should be cropping down to the size specified if all goes well, so I'm not sure where it's not going well Option to crop longer side of thumb - sbillard - 2009-08-09 Have you looked at the maxSize image functions? Anyway, it is i.php which has the behavior specifications. Option to crop longer side of thumb - ZeBoxx - 2009-08-09 maxSize? you mean maxSpace? I have - they don't deal with cropping, however I did look at i.php , which is what I was basing my expected behavior on;
So far so good, this should give me the image resampled to 130x86 pixels.
So therein will probably lay the problem I was facing - and should be able to fix my function now >_< . Option to crop longer side of thumb - sbillard - 2009-08-09 You have correctly understood how the cropping works. I guess we can make the documentation clearer. |