imgQuality = $quality; $this->x = $width; $this->y = $height; /* OS Detection */ if ( !isset($_ENV["OS"]) ) { $_ENV["OS"] = "UNIX"; } if ( preg_match("/win/i", $_ENV["OS"]) ) { // Windows $this->os = "WIN32"; } else { // Unix variant $this->os = "UNIX"; } } /* Write to disk tempory */ function diskWrite() { if ( $this->os == "WIN32" ) { /* Win32 */ $this->__tDiskFile = tempnam(WIN32TMP, "xsImageClass"); } else { /* Unix */ $this->__tDiskFile = tempnam(UNIXTMP, "xsImageClass"); } error_reporting(0); // Turn of error reporting ob_start(); Imagepng($this->img); $this->gd2 = ob_get_contents(); ob_end_clean(); error_reporting(E_ALL); // And back on $fp = fopen($this->__tDiskFile, "w"); fwrite($fp, $this->gd2); fclose($fp); } /* Restore data back from disk to memory */ function diskRestore() { $rbytes = filesize($this->__tDiskFile); $fp = fopen($this->__tDiskFile, "r"); $gd2Data = fread($fp, $rbytes); $this->img = ImageCreateFromString($gd2Data); fclose($fp); unlink($this->__tDiskFile); } /* Reads image data */ function getImage() { /* Start output buffer */ error_reporting(E_ALL); // Turn of error reporting ob_start(); imagejpeg($this->img, '', $this->imgQuality); $this->imgJpeg = ob_get_contents(); ob_end_clean(); error_reporting(E_ALL); // And back on return($this->imgJpeg); } /* Create decimal colors from an HTML style color */ function hexColors($color) { $color = preg_replace("/#/", "", $color); $res["r"] = hexdec(substr($color, 0, 2)); $res["g"] = hexdec(substr($color, 2, 2)); $res["b"] = hexdec(substr($color, 4, 2)); return($res); } /* Check if we need to reverse settings for X and Y axis when creating a vertical image.. */ function reverseXandY($sourcex, $sourcey, $ix, $iy) { /* Is the X axis longer then the Y axis */ if ( $sourcex > $sourcey ) { $_nx = $ix; $_ny = $iy; } else { $_ny = $ix; $_nx = $iy; } return(array($_nx, $_ny)); } /* Resize image */ function resize($filename, $bgcolor, $bordercolor = "#808080") { /* Gets image size of image to scale */ $elements = @getimagesize($filename); /* Open image with correct open function */ $source = $this->imageGdOpen($filename, $elements[2]); /* Check image position */ list($this->x, $this->y) = $this->reverseXandY(ImageSX($source), ImageSY($source), $this->x, $this->y); /* Create a new image */ $this->img = imagecreatetruecolor($this->x, $this->y); /* Fill image with background color */ $bgcolors = $this->hexColors($bgcolor); $bgc = imagecolorallocate ($this->img, $bgcolors["r"], $bgcolors["g"], $bgcolors["b"]); ImageFill($this->img, 0, 0, $bgc); /* Scale the image.. */ if ( ( ImageSX($source) < $this->x ) && ( ImageSY($source) < $this->y ) ) { ImageCopyResized( $this->img, $source, (($this->x / 2) - (ImageSX($source) / 2)), (($this->y / 2) - (ImageSY($source) / 2)), 0, 0, ImageSX($source), ImageSY($source), ImageSX($source), ImageSY($source)); } else { if ( ImageSX($source) > ImageSY($source) ) { $_RATIO = (float)(@ImageSX($source) / $this->x); $_X = (int)(@ImageSX($source) / $_RATIO); $_Y = (int)(@ImageSY($source) / $_RATIO); imagecopyresampled( $this->img, $source, (($this->x / 2) - ($_X / 2)), (($this->y / 2) - ($_Y / 2)), 0, 0, $_X, $_Y, ImageSX($source), ImageSY($source)); } else { $_RATIO = (float)(@ImageSY($source) / $this->y); $_X = (int)(@ImageSX($source) / $_RATIO); $_Y = (int)(@ImageSY($source) / $_RATIO); imagecopyresampled( $this->img, $source, (($this->x / 2) - ($_X / 2)), (($this->y / 2) - ($_Y / 2)), 0, 0, $_X, $_Y, ImageSX($source), ImageSY($source)); } } /* Add a border if required */ if ( $bordercolor ) { $brcolors = $this->hexColors($bordercolor); $brc = imagecolorallocate ($this->img, $brcolors["r"], $brcolors["g"], $brcolors["b"]); imagerectangle ($this->img, 0, 0, ($this->x - 1), ($this->x - 1), $brc); } /* Return true on succes... */ return(true); } /* Calculate horizontal image position */ function horizontalPosition($x, $place) { /* Horizontal */ switch ( $place ) { case LEFT: $res = 0; break;; case CENTER: $res = (int)round(($this->x - $x) / 2); break;; case RIGHT: $res = (int)($this->x - $x); break;; default: die("Don't know how to handle HORIZONTAL position."); break;; } return($res); } /* Calculate vertical image position */ function verticalPosition($y, $place) { /* Horizontal */ switch ( $place ) { case TOP: $res = 0; break;; case MIDDLE: $res = (int)round(($this->y - $y) / 2); break;; case BOTTOM: $res = (int)($this->y - $y); break;; default: die("Don't know how to handle VERTICAL position."); break;; } return($res); } /* GD Can Handle? */ function imageGdOpenHandle($type) { ob_start(); switch ( $type ) { case "1": /* GIF Image found */ $_Q = "imagecreatefromgif(NULL);"; break;; case "2": /* JPG Image found */ $_Q = "ImageCreateFromJpeg(NULL);"; break;; case "3": /* PNG Image found */ $_Q = "ImageCreateFromPng(NULL);"; break;; default: return(false); break;; } eval($_Q); $message = ob_get_contents(); ob_end_clean(); if ( preg_match("/warning/i", $message) ) { return(false); } else { return(true); } } /* fd2 Open Image */ function imageGdOpen($filename, $type) { switch ( $type ) { case "1": /* GIF Image found */ $ip = imagecreatefromgif($filename); break;; case "2": /* JPG Image found */ $ip = ImageCreateFromJpeg($filename); break;; case "3": /* PNG Image found */ $ip = ImageCreateFromPng($filename); break;; default: return(false); break;; } return($ip); } function addCopyright($filename, $x, $y) { /* Calculate position */ list($ix, $iy, $it, $iattr) = getimagesize($filename); $_x = $this->horizontalPosition($ix, $x); $_y = $this->verticalPosition($iy, $y); if ( $this->imageGdOpenHandle($it) ) { /* Load image to memory */ $clipImage = $this->imageGdOpen($filename, $it); imagecopy($this->img, $clipImage, $_x, $_y, 0, 0, $ix, $iy); ImageDestroy($clipImage); } else { /* Imagemagick required :) */ $this->diskWrite(); /* Code */ $this->diskRestore(); } } } ?> Dibatel.nl -
 
 
 
Dibate LOGO
Toestellen Accessoires Onderdelen Gereedschap Consumenten Contact Login
Artikelen 0 (0)
€ 0,00
 
















Producten / Onderdelen / Acer /

Momenteel zijn wij nog druk bezig met het invoeren van al onze producten, in principe leveren wij alles. Wanneer u een product niet kunt vinden op onze website neem dan contact met ons op, wij zullen er dan voor zorgen dat u het missende product alsnog kunt ontvangen!

Acer E2 Duo V370
Acer E3 Duo E380
Acer Iconia Tab A200
Acer Iconia Tab A210
Acer Liquid Gallant E350

Acer Liquid Z5


Momenteel zijn wij nog druk bezig met het invoeren van al onze producten, in principe leveren wij alles. Wanneer u een product niet kunt vinden op onze website neem dan contact met ons op, wij zullen er dan voor zorgen dat u het missende product alsnog kunt ontvangen!


Laatst bekeken


Samsung Galaxy S4 Advance i9506 Display Assembly / LCD+Digitizer+Frame Zwart

€ Login

Samsung Galaxy Mega 6.3 LTE i9205 Oorspeakerflex / Sensorflex

€ Login

Samsung Galaxy Core i8260 Touchscreen / Glasplaat / Digitizer Wit

€ Login

Nokia Lumia 1520 Vibrator / Trilfunctie

€ Login

Huawei Ascend G700 Display Assembly / LCD+Digitizer+Frame Zwart

€ Login


iPhone 4 Display Assembly / LCD+Digitizer Zwart copy

€ Login

Samsung Galaxy Note 2 N7100 Display Assembly / LCD+Digitizer+Frame Roze

€ Login

Samsung Galaxy S3 mini VE i8200 Display Assembly / LCD+Digitizer+Frame Blauw

€ Login

Nokia X2 Display Assembly / LCD+Digitizer+Frame Zwart

€ Login

Samsung Galaxy S3 i9300 Loudspeaker / Luidspreker / Koptelefooningang Blauw

€ Login

Dibatel Beverwijk (Hoofdvestiging)
Parallelweg 124-40
1948 NN Beverwijk
+31(0)165 - 75 14 18

beverwijk@dibatel.nl
www.dibatel.nl
Dibatel / Repair a Phone, Antwerpen
Kotterstraat 8
2030 Antwerpen
+32(0) - 32 91 59 01

antwerpen@dibatel.nl
www.dibatel.nl

Copyright © 2014 - dibatel.nl