Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You could use <code>getimagesize</code>to get the image size and type. Image type is return at index pos 2.</p> <p>1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(orden de bytes intel), 8 = TIFF(orden de bytes motorola), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. </p> <p><strong>Php doc for getimagesize()</strong> - <a href="http://php.net/manual/en/function.getimagesize.php" rel="nofollow">http://php.net/manual/en/function.getimagesize.php</a></p> <p><strong>Example usage:</strong></p> <pre><code>list($width, $height, $type) = getimagesize('herp-derp.png'); echo $type; </code></pre> <p>Edit: Useful comment from phpdoc notes....</p> <pre><code>In addition to thomporter's quick-reference of the output array, here's what PHP 4.4.0 does: Array[0] = Width Array[1] = Height Array[2] = Image Type Flag Array[3] = width="xxx" height="xxx" Array[bits] = bits Array[channels] = channels Array[mime] = mime-type </code></pre> <p><strong>Edit:</strong> <code>getImageType</code> returns one of IMAGICK_TYPE_* constants (http://www.phpf1.com/manual/imagick-getimagetype.html). You can find the list of constants here - <a href="http://php.net/manual/en/imagick.constants.php" rel="nofollow">http://php.net/manual/en/imagick.constants.php</a> .</p> <p><strong>IMGTYPE constants</strong></p> <p>imagick::IMGTYPE_UNDEFINED (integer)<br> imagick::IMGTYPE_BILEVEL (integer)<br> imagick::IMGTYPE_GRAYSCALE (integer)<br> imagick::IMGTYPE_GRAYSCALEMATTE (integer)<br> imagick::IMGTYPE_PALETTE (integer)<br> imagick::IMGTYPE_PALETTEMATTE (integer)<br> imagick::IMGTYPE_TRUECOLOR (integer)<br> imagick::IMGTYPE_TRUECOLORMATTE (integer)<br> imagick::IMGTYPE_COLORSEPARATION (integer)<br> imagick::IMGTYPE_COLORSEPARATIONMATTE (integer)<br> imagick::IMGTYPE_OPTIMIZE (integer) </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload