Avatar

My bug report re thumbnail and two additional bug reports (General)

by Micha ⌂, Tuesday, December 23, 2014, 16:35 (3411 days ago) @ Auge

Hi,

Why the script handles the file size not in a similar manner?

As far as I know(!), you can only define the quality parameter (for jpg) of an image during the re-sizing process, but you can't define the final file size.

2. The image of the snow made arctic hare is a portrait photo. The script turns the photo unwanted to landscape format.

Really? The code seems to be okay:

// resize if too large:
if($width > $settings['upload_max_img_width'] || $height > $settings['upload_max_img_height']) {
  if($width >= $height) {
    $new_width = $settings['upload_max_img_width'];
    $new_height = intval($height*$new_width/$width);
  }
  else {
    $new_height = $settings['upload_max_img_height'];
    $new_width = intval($width*$new_height/$height);
  }
}
else {
  $new_width=$width;
  $new_height=$height;
}

Have a nice Christmas!
Micha

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


Complete thread:

 RSS Feed of thread