• In our gallery, there are a number of images of people with an unpleasant tendency of getting their heads cut-off in the thumbnails. WP offers the ability of changing the crop position through an array that usually defaults to ['center', 'center']. For cases like the aforementioned, this would require ['center', 'top'] instead, but WPPP doesn’t seem to expose ways to change the default behavior for individual thumbnails, unfortunately.

    As a side note, there are quite more elaborate solutions based on face-recognition (like My Eyes Are Up Here), but WPPP isn’t compatible with any of those I’ve tested, in any of the rewrite modes (even crashes badly). Anyway, they’re resource-intensive and won’t fit well with the need for max. speed during on-the-fly thumbnail generation.

    I’ve already become aware the “Fast rewrite” mode imposes many limitations, as entire parts of core have been disabled in the name of greater performance. That’s fine, but there’s still a non-detrimental way to address the need to keep all heads in place, with the addition of a new filter. Namely:

    class.wppp_serve_image.php ~210

    foreach ( $sizes as $size => $size_data ) {
        $size_data[ 'crop' ] = apply_filters('wppp_dynimg_crop_position', $size_data[ 'crop' ], $this->localfilename );

    Making this filter work in SHORTINIT would imply the implementation of this another change request regarding sharpening support first.

    From the filter’s end, I fixed the issue by keeping a list of those images names that needed the different positioning. (For SHORTINIT to work, the filter code has to be inside a plugin.)

    I’m writing with hope the Author would implement his way to this at some point. Thanks in advance for your consideration, Bjoern.

  • The topic ‘Crop positioning per thumbnail. A proposal’ is closed to new replies.