downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Imagick::writeImageFile> <Imagick::whiteThresholdImage
[edit] Last updated: Fri, 17 May 2013

view this page in

Imagick::writeImage

(PECL imagick 0.9.0-0.9.9)

Imagick::writeImageEscribe una imagen al nombre de archivo especificado

Descripción

bool Imagick::writeImage ([ string $filename ] )

Escribe una imagen al nombre de archivo especificado. Si el parámetro filename es NULL, la imagen se escribe en el nombre de archivo establecido por Imagick::ReadImage() o Imagick::SetImageFilename().

Parámetros

filename

Valores devueltos

Devuelve TRUE en caso de éxito.



Imagick::writeImageFile> <Imagick::whiteThresholdImage
[edit] Last updated: Fri, 17 May 2013
 
add a note add a note User Contributed Notes Imagick::writeImage - [3 notes]
up
0
pfz at pfzone dot org
5 months ago
With Imagick 3.1.0RC2, PHP4.8
If you plan to overwrite the file you're working on, before doing writeImage, consider clearing the file buffer before the write statement :

<?php
$image
= new Imagick($your_file);
/* some processing */

clearstatcache(dirname($your_file));
// or
unlink($your_file);
$image->writeImage($your_file);
?>
It happened to me that the resulting file size was wrong. This could lead to truncation, as the file is not expanded.
This happened while working on JPEG, and PNG.

this line worked for me without this hack.
<?php
file_put_contents
($your_file, $image);
?>

Do not rely on getImageLength() for sending your image, especially when keepalive is ON. Content length is then relevant, and must be set. If the wrong size is given, your image will be truncated.
Use filesize($your_file_) once written or strlen($image) instead (which renders your image and updates getImageLength() result).
up
0
icinagle at gmail dot com
1 year ago
If you are trying to manipulate a uploaded file and then save the file all in the same request with Apache + mod_dav this will fail.
mod_dav puts a lock on the file during the request where the file is uploaded so trying to save the smallest file, e.g. 1kb will fail with a "Failed to allocate memory" error.
up
0
http://aotd.ru
5 years ago
$thumb = new Imagick();
$thumb->readImage('test.gif');
$thumb->writeImage('test.jpg');
$thumb->clear();
$thumb->destroy();

 
show source | credits | stats | sitemap | contact | advertising | mirror sites