imagecopyresampled() (Features)

by Micha ⌂, Saturday, June 01, 2013, 16:12 (2430 days ago) @ Alfie


This has a drawback if an image is within the dimension limits but the file size is too large.
Example: max dimension 640px, max filesize 100KB.
If an image is 300px wide and its filesize is 101KB it will be upscaled to 640px

I study the code and I can't confirm your description of the problem:

// get image size
$image_info = getimagesize($_FILES['probe']['tmp_name']);
// resize image, if it is too large
if($width > $settings['upload_max_img_width'] || $height > $settings['upload_max_img_height']) {}
// in your case, it is not to large, thus:
// calling resize_image-function to compress image
resize_image($_FILES['probe']['tmp_name'], $uploaded_images_path.$img_tmp_name, $new_width, $new_height, $compression)


applied-geodesy.org - OpenSource Least-Squares Adjustment Software for Geodetic Sciences

Complete thread:

 RSS Feed of thread

powered by my little forum