You are here

function resmushit_log in reSmush.it image style optimizer 7

Same name and namespace in other branches
  1. 7.2 resmushit.inc \resmushit_log()

Parameters

$imagesource:

$error:

$sizebefore:

$sizeafter:

$gain: Keep a log of last few optimalizations.

1 call to resmushit_log()
resmushit_effect in ./resmushit.inc

File

./resmushit.inc, line 30
Additional functions.

Code

function resmushit_log($imagesource, $error, $sizebefore, $sizeafter, $gain, $temp_path = FALSE) {
  $recent_optimalizations = resmushit_trimmed_log();
  $this_operation = array(
    date("Y-m-d H:i:s", REQUEST_TIME),
    $imagesource,
    $error,
    number_format(filesize($imagesource)),
    $sizebefore,
    $sizeafter,
    $gain,
  );
  $recent_optimalizations[] = $this_operation;
  variable_set('resmushit_recent_optimalizations', $recent_optimalizations);
  if ($temp_path) {

    // Since logging is the last operation in resmushit_effect() we may as well delete the temporary file.
    resmushit_delete_temp_file($temp_path);
  }
}