A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Epistol, 9 Years ago, written in PHP.
Embed
  1.  
  2.     public function makeThumbnails($updir, $img)
  3.     {
  4.         $thumbnail_width = 150;
  5.         $thumbnail_height = 150;
  6.         $thumb_beforeword = "thumb";
  7.         $arr_image_details = getimagesize("$updir" .  "$img"); // pass id to thumb name
  8.         $original_width = $arr_image_details[0];
  9.         $original_height = $arr_image_details[1];
  10.         if ($original_width > $original_height) {
  11.             $new_width = $thumbnail_width;
  12.             $new_height = intval($original_height * ($new_width / $original_width));
  13.             if($new_height < $new_width){
  14.                 $pourcentage = $thumbnail_height / $new_height;
  15.                 $new_height = ($new_height * $pourcentage );
  16.                 $new_width = ($new_width * $pourcentage);
  17.             }
  18.         } else {
  19.             $new_height = $thumbnail_height;
  20.             $new_width = intval($original_width * ($new_height / $original_height));
  21.             if($new_width < $new_height){
  22.                 $pourcentage = $thumbnail_width / $new_width;
  23.                 $new_height = ($new_height * $pourcentage );
  24.                 $new_width = ($new_width * $pourcentage);
  25.             }
  26.         }
  27.         $dest_x = intval(($thumbnail_width - $new_width) / 2);
  28.         $dest_y = intval(($thumbnail_height - $new_height) / 2);
  29.         if ($arr_image_details[2] == 1) {
  30.             $imgt = "ImageGIF";
  31.             $imgcreatefrom = "ImageCreateFromGIF";
  32.         }
  33.         if ($arr_image_details[2] == 2) {
  34.             $imgt = "ImageJPEG";
  35.             $imgcreatefrom = "ImageCreateFromJPEG";
  36.         }
  37.         if ($arr_image_details[2] == 3) {
  38.             $imgt = "ImagePNG";
  39.             $imgcreatefrom = "ImageCreateFromPNG";
  40.         }
  41.         if ($imgt) {
  42.             $old_image = $imgcreatefrom("$updir" .  "$img");
  43.             $new_image = imagecreatetruecolor($thumbnail_width, $thumbnail_height);
  44.             imagecopyresized($new_image, $old_image, $dest_x, $dest_y, 0, 0, $new_width, $new_height, $original_width, $original_height);
  45.             $imgt($new_image, "$updir" . "/thumbs/" . "$thumb_beforeword" . "$img");
  46.         }
  47.     }