PHP.mk документација

Imagick::coalesceImages

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

imagick.coalesceimages.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека imagick.coalesceimages.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
Imagick::coalesceImages

Референца за `imagick.coalesceimages.php` со подобрена типографија и навигација.

imagick.coalesceimages.php

Imagick::coalesceImages

(PECL imagick 2, PECL imagick 3)

Imagick::coalesceImagesComposites a set of images

= NULL

public Imagick::coalesceImages(): (PECL imagick 2, PECL imagick 3)

Composites a set of images while respecting any page offsets and disposal methods. GIF, MIFF, and MNG animation sequences typically start with an image background and each subsequent image varies in size and offset. Returns a new Imagick object where each image in the sequence is the same size as the first and composited with the next image in the sequence.

Параметри

Оваа функција нема параметри.

Вратени вредности

Враќа нов Imagick објект при успех.

Errors/Exceptions

Фрла ImagickException при грешка.

Белешки од корисници 3 белешки

ktr
пред 13 години
resize and/or crop an animated GIF

<?php
$image = new Imagick($file_src);

$image = $image->coalesceImages();

foreach ($image as $frame) {
  $frame->cropImage($crop_w, $crop_h, $crop_x, $crop_y);
  $frame->thumbnailImage($size_w, $size_h);
  $frame->setImagePage($size_w, $size_h, 0, 0);
}

$image = $image->deconstructImages();
$image->writeImages($file_dst, true);
?>
vikomic at gmail dot com
пред 14 години
Here goes an exaple how to resize GIF-s.

<?php
$imagick = new Imagick("original.gif");

$format = $imagick->getImageFormat();
if ($format == 'GIF') {
  $imagick = $imagick->coalesceImages();
  do {
     $imagick->resizeImage(120, 120, Imagick::FILTER_BOX, 1);
  } while ($imagick->nextImage());
  $imagick = $imagick->deconstructImages();
  $imagick->writeImages('new_120x120.gif', true);

  // can be added some more gifs
  $imagick = $imagick->coalesceImages();
  do {
     $imagick->resizeImage(100, 100, Imagick::FILTER_BOX, 1);
  } while ($imagick->nextImage());
  $imagick = $imagick->deconstructImages();
  $imagick->writeImages('new_100x100.gif', true);
}

$imagick->clear();
$imagick->destroy();
?>

You can use any resize method (resizeImage) with this example.

This example works fine with *imagick module version 2.2.1-dev*, but doesn't work correctly with *imagick module version 3.0.1*.
Anony
пред 10 години
If you wish to open an animated gif, don't ping the image with $imagick->pingImage(), you will get the same amount of frames you have in the gif, added to the start - but they're all black with stripes. So you have then double the amounts of frames the gif actually has.
Навигација

Прелистувај сродни теми и функции.

На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.