<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.imagecreatefromjpeg.php',
    1 => 'imagecreatefromjpeg',
    2 => 'Створює нове зображення з файла або URL',
  ),
  'up' => 
  array (
    0 => 'ref.image.php',
    1 => 'Функції GD та Image',
  ),
  'prev' => 
  array (
    0 => 'function.imagecreatefromgif.php',
    1 => 'imagecreatefromgif',
  ),
  'next' => 
  array (
    0 => 'function.imagecreatefrompng.php',
    1 => 'imagecreatefrompng',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/image/functions/imagecreatefromjpeg.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imagecreatefromjpeg" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imagecreatefromjpeg</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imagecreatefromjpeg</span> &mdash; <span class="dc-title">Створює нове зображення з файла або URL</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imagecreatefromjpeg-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imagecreatefromjpeg</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><span class="type"><a href="class.gdimage.php" class="type GdImage">GdImage</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imagecreatefromjpeg()</strong></span> returns an image identifier
   representing the image obtained from the given filename.
  </p>
  <div class="tip"><strong class="tip">Підказка</strong><p class="simpara">URL як назву файлу можна
використовувати з цією функцією, якщо ввімкнені <a href="filesystem.configuration.php#ini.allow-url-fopen" class="link">обгортки fopen</a>. Докладніше про те, як
вказати назву файлу: <span class="function"><a href="function.fopen.php" class="function">fopen()</a></span>. На сторінці <a href="wrappers.php" class="xref">Підтримувані протоколи та обгортки</a> є посилання на інформацію про можливості різних обгорток,
примітки щодо їхнього використання, інформацію про будь-які попередньо визначені
цими обгортками змінні.</p></div>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imagecreatefromjpeg-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Path to the JPEG image.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imagecreatefromjpeg-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">Повертає об&#039;єкт зображення в разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилок.</p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imagecreatefromjpeg-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       On success, this function returns a <span class="classname"><a href="class.gdimage.php" class="classname">GDImage</a></span> instance now;
       previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was returned.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imagecreatefromjpeg-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 Example to handle an error during loading of a JPEG</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">LoadJpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$imgname</span><span style="color: #007700">)<br />{<br />    </span><span style="color: #FF8000">/* Attempt to open */<br />    </span><span style="color: #0000BB">$im </span><span style="color: #007700">= @</span><span style="color: #0000BB">imagecreatefromjpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$imgname</span><span style="color: #007700">);<br /><br />    </span><span style="color: #FF8000">/* See if it failed */<br />    </span><span style="color: #007700">if(!</span><span style="color: #0000BB">$im</span><span style="color: #007700">)<br />    {<br />        </span><span style="color: #FF8000">/* Create a black image */<br />        </span><span style="color: #0000BB">$im  </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecreatetruecolor</span><span style="color: #007700">(</span><span style="color: #0000BB">150</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br />        </span><span style="color: #0000BB">$bgc </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">, </span><span style="color: #0000BB">255</span><span style="color: #007700">);<br />        </span><span style="color: #0000BB">$tc  </span><span style="color: #007700">= </span><span style="color: #0000BB">imagecolorallocate</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br />        </span><span style="color: #0000BB">imagefilledrectangle</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">150</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">, </span><span style="color: #0000BB">$bgc</span><span style="color: #007700">);<br /><br />        </span><span style="color: #FF8000">/* Output an error message */<br />        </span><span style="color: #0000BB">imagestring</span><span style="color: #007700">(</span><span style="color: #0000BB">$im</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">, </span><span style="color: #DD0000">'Error loading ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$imgname</span><span style="color: #007700">, </span><span style="color: #0000BB">$tc</span><span style="color: #007700">);<br />    }<br /><br />    return </span><span style="color: #0000BB">$im</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type: image/jpeg'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$img </span><span style="color: #007700">= </span><span style="color: #0000BB">LoadJpeg</span><span style="color: #007700">(</span><span style="color: #DD0000">'bogus.image'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">imagejpeg</span><span style="color: #007700">(</span><span style="color: #0000BB">$img</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>Поданий вище приклад виведе щось
схоже на:</p></div>
   <div class="mediaobject">
    
    <div class="imageobject">
     <img src="images/21009b70229598c6a80eef8b45bf282b-imagecreatefromjpeg.jpg" alt="Output of example : Example to handle an error during loading of a JPEG" width="150" height="30" />
    </div>
   </div>
  </div>
 </div>

</div><?php manual_footer($setup); ?>