Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 7677

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Adaptively resize image with data dependent triangulation</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.adaptiveblurimage.html">Imagick::adaptiveBlurImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.adaptivesharpenimage.html">Imagick::adaptiveSharpenImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.adaptiveresizeimage" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::adaptiveResizeImage</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::adaptiveResizeImage</span> &mdash; <span class="dc-title">Adaptively resize image with data dependent triangulation</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.adaptiveresizeimage-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Imagick::adaptiveResizeImage</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$columns</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$rows</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$bestfit</code><span class="initializer"> = false</span></span>
  ] )</div>

  <p class="para rdfs-comment">
   Adaptively resize image with data-dependent triangulation. Avoids
   blurring across sharp color changes. Most useful when used to shrink
   images slightly to a slightly smaller &quot;web size&quot;; may not look good
   when a full-sized image is adaptively resized to a thumbnail.
   This method is available if Imagick has been compiled against ImageMagick version 6.2.9 or newer.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
 <span class="simpara">
  The behavior of the parameter <em><code class="parameter">bestfit</code></em> changed in Imagick 3.0.0.
  Before this version given dimensions 400x400 an image of dimensions 200x150 would be
  left untouched. In Imagick 3.0.0 and later the image would be scaled up to size 400x300 as
  this is the &quot;best fit&quot; for the given dimensions. If <em><code class="parameter">bestfit</code></em>
  parameter is used both width and height must be given.
 </span>
</p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.adaptiveresizeimage-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">columns</code></em></span>
     <dd>

      <p class="para">
       The number of columns in the scaled image.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">rows</code></em></span>
     <dd>

      <p class="para">
       The number of rows in the scaled image.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">bestfit</code></em></span>
     <dd>

      <p class="para">
       Whether to fit the image inside a bounding box.
      </p>
     </dd>

    </dt>

   </dl>

  </p>

 </div>

 <div class="refsect1 returnvalues" id="refsect1-imagick.adaptiveresizeimage-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.adaptiveresizeimage-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   Throws ImagickException on error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-imagick.adaptiveresizeimage-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>2.1.0</td>
       <td>Added optional fit parameter.</td>
      </tr>

      <tr>
       <td>2.1.0</td>
       <td>
       This method now supports proportional scaling.
       Pass zero as either parameter for proportional scaling.  
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-imagick.adaptiveresizeimage-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-3307">
    <p><strong>Example #1 Using  <span class="function"><strong>Imagick::adaptiveResizeImage()</strong></span></strong></p>
    <div class="example-contents"><p>
     Resize an image to a standard size for the web.  This method works best
     when resizing to a size only slightly smaller than the previous image
     size.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-type:&nbsp;image/jpeg'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$image&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #DD0000">'image.jpg'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$image</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">adaptiveResizeImage</span><span style="color: #007700">(</span><span style="color: #0000BB">1024</span><span style="color: #007700">,</span><span style="color: #0000BB">768</span><span style="color: #007700">);<br /><br />echo&nbsp;</span><span style="color: #0000BB">$image</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-imagick.adaptiveresizeimage-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="imagick.chopimage.html" class="function" rel="rdfs-seeAlso">Imagick::chopImage()</a> - Removes a region of an image and trims</span></li>
    <li class="member"> <span class="function"><a href="imagick.cropimage.html" class="function" rel="rdfs-seeAlso">Imagick::cropImage()</a> - Extracts a region of the image</span></li>
    <li class="member"> <span class="function"><a href="imagick.magnifyimage.html" class="function" rel="rdfs-seeAlso">Imagick::magnifyImage()</a> - Scales an image proportionally 2x</span></li>
    <li class="member"> <span class="function"><a href="imagick.minifyimage.html" class="function" rel="rdfs-seeAlso">Imagick::minifyImage()</a> - Scales an image proportionally to half its size</span></li>
    <li class="member"> <span class="function"><a href="imagick.resizeimage.html" class="function" rel="rdfs-seeAlso">Imagick::resizeImage()</a> - Scales an image</span></li>
    <li class="member"> <span class="function"><a href="imagick.scaleimage.html" class="function" rel="rdfs-seeAlso">Imagick::scaleImage()</a> - Scales the size of an image</span></li>
    <li class="member"> <span class="function"><a href="imagick.shaveimage.html" class="function" rel="rdfs-seeAlso">Imagick::shaveImage()</a> - Shaves pixels from the image edges</span></li>
    <li class="member"> <span class="function"><a href="imagick.thumbnailimage.html" class="function" rel="rdfs-seeAlso">Imagick::thumbnailImage()</a> - Changes the size of an image</span></li>
    <li class="member"> <span class="function"><a href="imagick.trimimage.html" class="function" rel="rdfs-seeAlso">Imagick::trimImage()</a> - Remove edges from the image</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.adaptiveblurimage.html">Imagick::adaptiveBlurImage</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.adaptivesharpenimage.html">Imagick::adaptiveSharpenImage</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>