class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
On an image with a greater width than height the rendered 'thumbnail' is cropped from the left of the photo. So portraits are off center. How do I force this to grab the cropped image from the center of the scaled image?Reply
Read the docs for image_ratio_crop. Your code explicitly set it as L, which keeps the left-most part of the image of cropping. Just set it to true in order to get the center.Reply
if (($handle->image_src_x) > 1024 or ($handle->image_src_y) > 1024) { $handle->image_resize = true; $handle->image_y = 1024; $handle->image_x = 1024; $handle->image_ratio = true; } $handle->file_new_name_body = $_title; $handle->image_convert = 'jpg';On an image with a greater width than height the rendered 'thumbnail' is cropped from the left of the photo. So portraits are off center. How do I force this to grab the cropped image from the center of the scaled image?
THIS code please: