• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP imagecreatefromjpeg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中imagecreatefromjpeg函数的典型用法代码示例。如果您正苦于以下问题:PHP imagecreatefromjpeg函数的具体用法?PHP imagecreatefromjpeg怎么用?PHP imagecreatefromjpeg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了imagecreatefromjpeg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: load

 static function load($filename)
 {
     $info = getimagesize($filename);
     list($width, $height) = $info;
     if (!$width || !$height) {
         return null;
     }
     $image = null;
     switch ($info['mime']) {
         case 'image/gif':
             $image = imagecreatefromgif($filename);
             break;
         case 'image/jpeg':
             $image = imagecreatefromjpeg($filename);
             break;
         case 'image/png':
             $image = imagecreatetruecolor($width, $height);
             $white = imagecolorallocate($image, 255, 255, 255);
             imagefill($image, 0, 0, $white);
             $png = imagecreatefrompng($filename);
             imagealphablending($png, true);
             imagesavealpha($png, true);
             imagecopy($image, $png, 0, 0, 0, 0, $width, $height);
             imagedestroy($png);
             break;
     }
     if ($image) {
         return new image($image, $width, $height);
     } else {
         return null;
     }
 }
开发者ID:nyan-cat,项目名称:easyweb,代码行数:32,代码来源:image.php


示例2: hacknrollify

function hacknrollify($picfilename)
{
    $logofilename = "logo.png";
    $logoPicPath = "logopics/" . $logofilename;
    $originalPicPath = "originalpics/" . $picfilename;
    $editedfilename = "hnr_" . $picfilename;
    $editedPicPath = "editedpics/" . $editedfilename;
    // read the original image from file
    $profilepic = imagecreatefromjpeg($originalPicPath);
    $profilepicWidth = imagesx($profilepic);
    $profilepicHeight = imagesy($profilepic);
    // create the black image overlay
    $blackoverlay = imagecreate($profilepicWidth, $profilepicHeight);
    imagecolorallocate($blackoverlay, 0, 0, 0);
    // then merge the black and profilepic
    imagecopymerge($profilepic, $blackoverlay, 0, 0, 0, 0, $profilepicWidth, $profilepicHeight, 50);
    imagedestroy($blackoverlay);
    // merge the resized logo
    $logo = resizeImage($logoPicPath, $profilepicWidth - 80, 999999);
    imageAlphaBlending($logo, false);
    imageSaveAlpha($logo, true);
    $logoWidth = imagesx($logo);
    $logoHeight = imagesy($logo);
    $verticalOffset = $profilepicHeight / 2 - $logoHeight / 2;
    $horizontalOffset = 40;
    imagecopyresampled($profilepic, $logo, $horizontalOffset, $verticalOffset, 0, 0, $logoWidth, $logoHeight, $logoWidth, $logoHeight);
    $mergeSuccess = imagejpeg($profilepic, $editedPicPath);
    if (!$mergeSuccess) {
        echo "Image merge failed!";
    }
    imagedestroy($profilepic);
    imagedestroy($logo);
    return $editedPicPath;
}
开发者ID:nicholaslum444,项目名称:HacknRollify,代码行数:34,代码来源:lib_hacknrollify.php


示例3: createthumb

function createthumb($originalImage, $new_w, $new_h)
{
    $src_img = imagecreatefromjpeg("uploads/" . $originalImage);
    # Add the _t to our image name
    list($imageName, $extension) = explode(".", $originalImage);
    $newName = $imageName . "_t." . $extension;
    # Maintain proportions
    $old_x = imageSX($src_img);
    $old_y = imageSY($src_img);
    if ($old_x > $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $old_y * ($new_h / $old_x);
    }
    if ($old_x < $old_y) {
        $thumb_w = $old_x * ($new_w / $old_y);
        $thumb_h = $new_h;
    }
    if ($old_x == $old_y) {
        $thumb_w = $new_w;
        $thumb_h = $new_h;
    }
    # Create destination-image-resource
    $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);
    # Copy source-image-resource to destination-image-resource
    imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    # Create the final image from the destination-image-resource
    imagejpeg($dst_img, "uploads/" . $newName);
    # Delete our image-resources
    imagedestroy($dst_img);
    imagedestroy($src_img);
    # Show results
    return $newName;
}
开发者ID:ritarafaeli,项目名称:notes,代码行数:33,代码来源:uploaderExample_functions.php


示例4: load

 /**
  * Load an image
  *
  * @param $filename
  * @return Image
  * @throws Exception
  */
 public static function load($filename)
 {
     $instance = new self();
     // Require GD library
     if (!extension_loaded('gd')) {
         throw new Exception('Required extension GD is not loaded.');
     }
     $instance->filename = $filename;
     $info = getimagesize($instance->filename);
     switch ($info['mime']) {
         case 'image/gif':
             $instance->image = imagecreatefromgif($instance->filename);
             break;
         case 'image/jpeg':
             $instance->image = imagecreatefromjpeg($instance->filename);
             break;
         case 'image/png':
             $instance->image = imagecreatefrompng($instance->filename);
             imagesavealpha($instance->image, true);
             imagealphablending($instance->image, true);
             break;
         default:
             throw new Exception('Invalid image: ' . $instance->filename);
             break;
     }
     $instance->original_info = array('width' => $info[0], 'height' => $info[1], 'orientation' => $instance->get_orientation(), 'exif' => function_exists('exif_read_data') ? $instance->exif = @exif_read_data($instance->filename) : null, 'format' => preg_replace('/^image\\//', '', $info['mime']), 'mime' => $info['mime']);
     $instance->width = $info[0];
     $instance->height = $info[1];
     imagesavealpha($instance->image, true);
     imagealphablending($instance->image, true);
     return $instance;
 }
开发者ID:SerdarSanri,项目名称:arx-core,代码行数:39,代码来源:Image.php


示例5: upload

function upload($tmp, $name, $nome, $larguraP, $pasta)
{
    $ext = strtolower(end(explode('.', $name)));
    if ($ext == 'jpg') {
        $img = imagecreatefromjpeg($tmp);
    } elseif ($ext == 'gif') {
        $img = imagecreatefromgif($tmp);
    } else {
        $img = imagecreatefrompng($tmp);
    }
    $x = imagesx($img);
    $y = imagesy($img);
    $largura = $x > $larguraP ? $larguraP : $x;
    $altura = $largura * $y / $x;
    if ($altura > $larguraP) {
        $altura = $larguraP;
        $largura = $altura * $x / $y;
    }
    $nova = imagecreatetruecolor($largura, $altura);
    imagecopyresampled($nova, $img, 0, 0, 0, 0, $largura, $altura, $x, $y);
    imagejpeg($nova, "{$pasta}/{$nome}");
    imagedestroy($img);
    imagedestroy($nova);
    return $nome;
}
开发者ID:mauriliovilela,项目名称:ser-social,代码行数:25,代码来源:funcoes.php


示例6: resize

function resize($photo_src, $width, $name)
{
    $parametr = getimagesize($photo_src);
    list($width_orig, $height_orig) = getimagesize($photo_src);
    $ratio_orig = $width_orig / $height_orig;
    $new_width = $width;
    $new_height = $width / $ratio_orig;
    $newpic = imagecreatetruecolor($new_width, $new_height);
    $col2 = imagecolorallocate($newpic, 255, 255, 255);
    imagefilledrectangle($newpic, 0, 0, $new_width, $new_width, $col2);
    switch ($parametr[2]) {
        case 1:
            $image = imagecreatefromgif($photo_src);
            break;
        case 2:
            $image = imagecreatefromjpeg($photo_src);
            break;
        case 3:
            $image = imagecreatefrompng($photo_src);
            break;
    }
    imagecopyresampled($newpic, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);
    imagejpeg($newpic, $name, 100);
    return true;
}
开发者ID:pioytazsko,项目名称:garantmarket,代码行数:25,代码来源:new_item.php


示例7: GetPartialImage

function GetPartialImage($url)
{
	$W = 150;
	$H = 130;
	$F = 80;
	$STEP = 1.0 / $F;
	$im = imagecreatefromjpeg($url);
	$dest = imagecreatetruecolor($W, $H);
	imagecopy($dest, $im, 0, 0, 35, 40, $W, $H);
	
	$a = 1;
	for( $y = $H - $F; $y < $H; $y++ )
	{
		for ( $x = 0; $x < $W; $x++ )
		{
			$i = imagecolorat($dest, $x, $y);
			$c = imagecolorsforindex($dest, $i);
			$c = imagecolorallocate($dest, 
				a($c['red'], $a),
				a($c['green'], $a), 
				a($c['blue'], $a)
			);
			imagesetpixel($dest, $x, $y, $c);
		}
		$a -= $STEP;
	}
	
	header('Content-type: image/png');
	imagepng($dest);
	imagedestroy($dest);
	imagedestroy($im);
}
开发者ID:ryanknu,项目名称:Cuber,代码行数:32,代码来源:image.php


示例8: mkdir

             mkdir($dir . $p, 0755);
         }
     }
     return $p;
 }
 private static function _init($file)
 {
     $info = getimagesize($file);
     $method = $im = $ext = null;
     switch ($info['mime']) {
         case 'image/jpeg':
         case 'image/jpg':
             $ext = '.jpg';
             $im = imagecreatefromjpeg($file);
             $method = 'imagejpeg';
             break;
         case 'image/gif':
             $ext = '.gif';
             $im = imagecreatefromgif($file);
             $method = 'imagegif';
             break;
         case 'image/png':
             $ext = '.png';
             $im = imagecreatefrompng($file);
             $method = 'imagepng';
             break;
         case 'image/bmp':
             $ext = '.bmp';
             $im = imagecreatefrombmp($file);
             $method = 'imagepng';
             break;
开发者ID:xiaoniainiu,项目名称:php-yaf-yk,代码行数:31,代码来源:upload.php


示例9: background

 function background()
 {
     $im = imagecreatetruecolor($this->width, $this->height);
     $bgs = array();
     if ($this->style & 8 && function_exists('imagecreatefromjpeg') && function_exists('imagecopymerge')) {
         if ($fp = @opendir($GLOBALS['imgdir'] . '/ck/bg/')) {
             while ($flie = @readdir($fp)) {
                 if (preg_match('/\\.jpg$/i', $flie)) {
                     $bgs[] = $GLOBALS['imgdir'] . '/ck/bg/' . $flie;
                 }
             }
             @closedir($fp);
         }
     }
     if ($bgs) {
         $imbg = imagecreatefromjpeg($bgs[array_rand($bgs)]);
         imagecopymerge($im, $imbg, 0, 0, mt_rand(0, 200 - $this->width), mt_rand(0, 80 - $this->height), $this->width, $this->height, 100);
         imagedestroy($imbg);
     } else {
         $c = array();
         for ($i = 0; $i < 3; $i++) {
             $c[$i] = mt_rand(200, 255);
             $step[$i] = (mt_rand(100, 150) - $c[$i]) / $this->width;
         }
         for ($i = 0; $i < $this->width; $i++) {
             imageline($im, $i, 0, $i, $this->height, imagecolorallocate($im, $c[0], $c[1], $c[2]));
             $c[0] += $step[0];
             $c[1] += $step[1];
             $c[2] += $step[2];
         }
     }
     return $im;
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:33,代码来源:ck.php


示例10: openImage

 private function openImage($file)
 {
     // *** Get extension
     $extension = strtolower(strrchr($file, '.'));
     //$extension = DataHandler::returnExtensionOfFile($file);
     switch ($extension) {
         case '.jpg':
         case '.jpeg':
             $img = @imagecreatefromjpeg($file);
             break;
         case '.gif':
             $img = @imagecreatefromgif($file);
             break;
         case '.png':
             $img = @ImageCreateFromPNG($file);
             //                        //abaixo do php.net
             //                        imagealphablending($img, false);
             //						imagesavealpha($img, true);
             break;
         default:
             $img = false;
             break;
     }
     return $img;
 }
开发者ID:reytuty,项目名称:facil,代码行数:25,代码来源:ResizeImage.class.php


示例11: __construct

 public function __construct($filepath)
 {
     if (!function_exists('gd_info')) {
         throw new Hayate_Exception(_('GD extension is missing.'));
     }
     if (!is_file($filepath)) {
         throw new Hayate_Exception(sprintf(_('Cannot find %s'), $filepath));
     }
     $this->filepath = $filepath;
     $info = getimagesize($this->filepath);
     if (false === $info) {
         throw new Hayate_Exception(sprintf(_('Cannot read %s'), $filepath));
     }
     list($this->width, $this->height) = $info;
     $mimes = array('image/jpeg' => 'jpg', 'image/pjpeg' => 'jpg', 'image/gif' => 'gif', 'image/png' => 'png');
     $this->ext = isset($mimes[$info['mime']]) ? $mimes[$info['mime']] : null;
     if (null === $this->ext) {
         throw new Hayate_Exception(sprintf(_('Supported mime types are: %s'), implode(',', array_keys($mimes))));
     }
     switch ($this->ext) {
         case 'jpg':
             $this->img = imagecreatefromjpeg($filepath);
             break;
         case 'gif':
             $this->img = imagecreatefromgif($filepath);
             break;
         case 'png':
             $this->img = imagecreatefrompng($filepath);
             break;
     }
 }
开发者ID:hayate,项目名称:hayate,代码行数:31,代码来源:Image.php


示例12: cropnsave

 public function cropnsave($id)
 {
     $basepath = app_path() . '/storage/uploads/';
     $jpeg_quality = 90;
     $src = $basepath . 'resize_' . $id;
     if (ImageModel::getImgTypeByExtension($id) == ImageModel::IMGTYPE_PNG) {
         $img_r = imagecreatefrompng($src);
     } else {
         $img_r = imagecreatefromjpeg($src);
     }
     $dst_r = ImageCreateTrueColor(Input::get('w'), Input::get('h'));
     imagecopyresampled($dst_r, $img_r, 0, 0, Input::get('x'), Input::get('y'), Input::get('w'), Input::get('h'), Input::get('w'), Input::get('h'));
     $filename = $basepath . 'crop_' . $id;
     imagejpeg($dst_r, $filename, $jpeg_quality);
     $image = ImageModel::createImageModel('crop_' . $id);
     try {
         $session = Session::get('user');
         $userService = new SoapClient(Config::get('wsdl.user'));
         $currentUser = $userService->getUserById(array("userId" => $session['data']->id));
         $currentUser = $currentUser->user;
         $currentUser->avatar = $image;
         $result = $userService->updateUser(array("user" => $currentUser));
         // Cleanup
         File::delete($src);
         File::delete($filename);
         File::delete($basepath . $id);
         return Response::json($result->complete);
     } catch (Exception $ex) {
         error_log($ex);
     }
 }
开发者ID:Yatko,项目名称:Gifteng,代码行数:31,代码来源:ImageController.php


示例13: create_pic

function create_pic($upfile, $new_path, $width)
{
    $quality = 100;
    $image_path = $upfile;
    $image_info = getimagesize($image_path);
    $exname = '';
    //1  =  GIF,  2  =  JPG,  3  =  PNG,  4  =  SWF,  5  =  PSD,  6  =  BMP,  7  =  TIFF(intel  byte  order),  8  =  TIFF(motorola  byte  order),  9  =  JPC,  10  =  JP2,  11  =  JPX,  12  =  JB2,  13  =  SWC,  14  =  IFF
    switch ($image_info[2]) {
        case 1:
            @($image = imagecreatefromgif($image_path));
            $exname = 'gif';
            break;
        case 2:
            @($image = imagecreatefromjpeg($image_path));
            $exname = 'jpg';
            break;
        case 3:
            @($image = imagecreatefrompng($image_path));
            $exname = 'png';
            break;
        case 6:
            @($image = imagecreatefromwbmp($image_path));
            $exname = 'wbmp';
            break;
    }
    $T_width = $image_info[0];
    $T_height = $image_info[1];
    if (!empty($image)) {
        $image_x = imagesx($image);
        $image_y = imagesy($image);
    } else {
        return FALSE;
    }
    @chmod($new_path, 0777);
    if ($image_x > $width) {
        $x = $width;
        $y = intval($x * $image_y / $image_x);
    } else {
        @copy($image_path, $new_path . '.' . $exname);
        return $exname;
    }
    $newimage = imagecreatetruecolor($x, $y);
    imagecopyresampled($newimage, $image, 0, 0, 0, 0, $x, $y, $image_x, $image_y);
    switch ($image_info[2]) {
        case 1:
            imagegif($newimage, $new_path . '.gif', $quality);
            break;
        case 2:
            imagejpeg($newimage, $new_path . '.jpg', $quality);
            break;
        case 3:
            imagepng($newimage, $new_path . '.png', $quality);
            break;
        case 6:
            imagewbmp($newimage, $new_path . '.wbmp', $quality);
            break;
    }
    imagedestroy($newimage);
    return $exname;
}
开发者ID:yunsite,项目名称:cyaskuc,代码行数:60,代码来源:global.func.php


示例14: resizewidth

 static function resizewidth($width, $imageold, $imagenew)
 {
     $image_info = getimagesize($imageold);
     $image_type = $image_info[2];
     if ($image_type == IMAGETYPE_JPEG) {
         $image = imagecreatefromjpeg($imageold);
     } elseif ($this->image_type == IMAGETYPE_GIF) {
         $image = imagecreatefromgif($imageold);
     } elseif ($this->image_type == IMAGETYPE_PNG) {
         $image = imagecreatefrompng($imageold);
     }
     $ratio = imagesy($image) / imagesx($image);
     $height = $width * $ratio;
     //$width = imagesx($image) * $width/100;
     // $height = imagesx($image) * $width/100;
     $new_image = imagecreatetruecolor($width, $height);
     imagecopyresampled($new_image, $image, 0, 0, 0, 0, $width, $height, $image_info[0], $image_info[1]);
     $image = $new_image;
     $compression = 75;
     $permissions = null;
     if ($image_type == IMAGETYPE_JPEG) {
         imagejpeg($image, $imagenew, $compression);
     } elseif ($image_type == IMAGETYPE_GIF) {
         imagegif($image, $imagenew);
     } elseif ($image_type == IMAGETYPE_PNG) {
         imagepng($image, $imagenew);
     }
     if ($permissions != null) {
         chmod($imagenew, $permissions);
     }
 }
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:31,代码来源:SimpleImage.php


示例15: get_image

function get_image($file)
{
    /*
    	Create a resource from image file and return it with getimagesize() array
    	$file - image file or resource
    	return array('res'=>$image_resource, 'imgsize'=>getimagesize($file))
    */
    if (is_file($file) === true && file_exists($file) === true && is_readable($file) === true) {
        $img_size = getimagesize($file);
        if ($img_size !== false) {
            $im_mime = $img_size['mime'];
            // Get the image from file
            if ($im_mime === 'image/jpeg') {
                $res = imagecreatefromjpeg($file);
            } else {
                if ($im_mime === 'image/gif') {
                    $res = imagecreatefromgif($file);
                } else {
                    if ($im_mime === 'image/png') {
                        $res = imagecreatefrompng($file);
                    } else {
                        // Exit if not supported format
                        return false;
                    }
                }
            }
            return array('res' => $res, 'imgsize' => $img_size);
        }
    }
    return false;
}
开发者ID:rosko,项目名称:Tempo-CMS,代码行数:31,代码来源:img_function.php


示例16: openImage

 private function openImage($file)
 {
     // *** Get extension
     $extension = strtolower(strrchr($file, '.'));
     $file_size = @filesize($file) / 1024 / 1024;
     // magic number convert bytes to mb
     $image_size_limit = 0.5;
     // sorry for the magic numbering... can't get a good read on how to programatically fix this.
     // if we're about to try to load a massive image...
     // don't
     if ($file_size >= $image_size_limit || $file_size == 0) {
         return false;
     }
     switch ($extension) {
         case '.jpg':
         case '.jpeg':
             $img = imagecreatefromjpeg($file);
             break;
         case '.gif':
             $img = @imagecreatefromgif($file);
             break;
         case '.png':
             $img = @imagecreatefrompng($file);
             break;
         default:
             $img = false;
             break;
     }
     return $img;
 }
开发者ID:lytranuit,项目名称:wordpress,代码行数:30,代码来源:image-resize-writer.php


示例17: setImage

 /**
  * Set the image variable by using image create
  *
  * @param string $filename - The image filename
  */
 private function setImage($filename)
 {
     $size = getimagesize($filename);
     $this->ext = $size['mime'];
     switch ($this->ext) {
         // Image is a JPG
         case 'image/jpg':
         case 'image/jpeg':
             // create a jpeg extension
             $this->image = imagecreatefromjpeg($filename);
             break;
             // Image is a GIF
         // Image is a GIF
         case 'image/gif':
             $this->image = @imagecreatefromgif($filename);
             break;
             // Image is a PNG
         // Image is a PNG
         case 'image/png':
             $this->image = @imagecreatefrompng($filename);
             break;
             // Mime type not found
         // Mime type not found
         default:
             throw new Exception("File is not an image, please use another file type.", 1);
     }
     $this->origWidth = imagesx($this->image);
     $this->origHeight = imagesy($this->image);
 }
开发者ID:swarajjena,项目名称:hackathon,代码行数:34,代码来源:Resize_image.php


示例18: save

 public function save()
 {
     $maxHeight = 0;
     $width = 0;
     foreach ($this->_segmentsArray as $segment) {
         $maxHeight = max($maxHeight, $segment->height);
         $width += $segment->width;
     }
     // create our canvas
     $img = imagecreatetruecolor($width, $maxHeight);
     $background = imagecolorallocatealpha($img, 255, 255, 255, 127);
     imagefill($img, 0, 0, $background);
     imagealphablending($img, false);
     imagesavealpha($img, true);
     // start placing our images on a single x axis
     $xPos = 0;
     foreach ($this->_segmentsArray as $segment) {
         $tmp = imagecreatefromjpeg($segment->pathToImage);
         imagecopy($img, $tmp, $xPos, 0, 0, 0, $segment->width, $segment->height);
         $xPos += $segment->width;
         imagedestroy($tmp);
     }
     // create our final output image.
     imagepng($img, $this->_saveToPath);
 }
开发者ID:ejacobs,项目名称:css-sprite,代码行数:25,代码来源:CssSprite.php


示例19: _thumb

function _thumb($_filename, $_percent)
{
    //生成png标头文件
    header('Content-type: image/png');
    $_n = explode('.', $_filename);
    //获取文件信息,长和高
    list($_width, $_height) = getimagesize($_filename);
    //生成缩微的长和高
    $_new_width = $_width * $_percent;
    $_new_height = $_height * $_percent;
    //创建一个以0.3百分比新长度的画布
    $_new_image = imagecreatetruecolor($_new_width, $_new_height);
    //按照已有的图片创建一个画布
    switch ($_n[1]) {
        case 'jpg':
            $_image = imagecreatefromjpeg($_filename);
            break;
        case 'png':
            $_image = imagecreatefrompng($_filename);
            break;
        case 'gif':
            $_image = imagecreatefrompng($_filename);
            break;
    }
    //将原图采集后重新复制到新图上,就缩略了
    imagecopyresampled($_new_image, $_image, 0, 0, 0, 0, $_new_width, $_new_height, $_width, $_height);
    imagepng($_new_image);
    imagedestroy($_new_image);
    imagedestroy($_image);
}
开发者ID:zhangshuhui2014,项目名称:foodcool,代码行数:30,代码来源:global.func.php


示例20: Imagem

 /**
  * MÉTODO CONSTRUTOR
  *
  * @author Gibran
  */
 function Imagem($arquivo)
 {
     if (is_file($arquivo)) {
         $this->Arquivo = $arquivo;
         // OBTÉM OS DADOS DA IMAGEM
         $this->ColecaoDados = getimagesize($this->Arquivo);
         // CARREGA A IMAGEM DE ACORDO COM O TIPO
         switch ($this->ColecaoDados[2]) {
             case 1:
                 $this->Recurso = imagecreatefromgif($this->Arquivo);
                 $this->Tipo = "image/gif";
                 break;
             case 2:
                 $this->Recurso = imagecreatefromjpeg($this->Arquivo);
                 $this->Tipo = "image/jpeg";
                 imageinterlace($this->Recurso, true);
                 break;
             case 3:
                 $this->Recurso = imagecreatefrompng($this->Arquivo);
                 $this->Tipo = "image/png";
                 imagealphablending($this->Recurso, false);
                 imagesavealpha($this->Recurso, true);
                 break;
             default:
                 $this->ColecaoDados = null;
                 $this->Recurso = null;
                 $this->Tipo = null;
                 return null;
                 break;
         }
     } else {
         return null;
     }
 }
开发者ID:BGCX067,项目名称:f1n4l-pr0j3c7-f0r-t3h-0n35-wh0-n33d-17-svn-to-git,代码行数:39,代码来源:Imagem.php



注:本文中的imagecreatefromjpeg函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP imagecreatefrompng函数代码示例发布时间:2022-05-15
下一篇:
PHP imagecreatefromgif函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap