You are here

function convert_image in TinyBrowser 7

3 calls to convert_image()
edit.php in tinybrowser/edit.php
tinybrowser.php in tinybrowser/tinybrowser.php
upload_process.php in tinybrowser/upload_process.php

File

tinybrowser/fns_tinybrowser.php, line 208

Code

function convert_image($imagetemp, $imagetype) {
  if ($imagetype == 'image/pjpeg' || $imagetype == 'image/jpeg') {
    $cim1 = imagecreatefromjpeg($imagetemp);
  }
  elseif ($imagetype == 'image/x-png' || $imagetype == 'image/png') {
    $cim1 = imagecreatefrompng($imagetemp);
    imagealphablending($cim1, false);
    imagesavealpha($cim1, true);
  }
  elseif ($imagetype == 'image/gif') {
    $cim1 = imagecreatefromgif($imagetemp);
  }
  return $cim1;
}