文字

Imagick::readImageFile

(PECL imagick 2.0.0)

Imagick::readImageFileReads image from open filehandle

说明

bool Imagick::readImageFile ( resource $filehandle [, string $fileName = null ] )

Reads image from open filehandle

参数

filehandle

fileName

返回值

成功时返回 TRUE

错误/异常

错误时抛出 ImagickException。

用户评论:

[#1] quickshiftin at gmail dot com [2014-11-20 07:15:06]

The second parameter will update the result of getFilename() if set. Otherwise the result of getFilename() will retain its original value, prior to calling readImageFile().

[#2] ben dot james at acknowledgement dot co dot uk [2008-12-26 13:00:27]

An example of reading an image file from a URL, using a handle returned by fopen():

<?php
$handle 
fopen('http://example.com/foo.jpg''rb');
$img = new Imagick();
$img->readImageFile($handle);
$img->resizeImage(12812800);
$img->writeImage('images/foo.jpg');
?>

上一篇: 下一篇: