# Graphics

> Section in “Backward Incompatible Changes › Changed Semantics” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/backward-incompatible-changes/changed-semantics/graphics/>

## Changed MIME type for `getimagesize()`

Even without any extensions like `gd` or `imagemagick`, PHP can provide you with information about images:

``` php
var_dump(getimagesize('/path/to/image.jpg'));
```

The result is an array, including, among other things, the MIME type of the image:

    array(7) {
      [0]=>
      int(1024)
      [1]=>
      int(683)
      [2]=>
      int(2)
      [3]=>
      string(25) "width="1024" height="683""
      ["bits"]=>
      int(8)
      ["channels"]=>
      int(3)
      ["mime"]=>
      string(10) "image/jpeg"
    }

If you happen to work with bitmaps, you need to know that their MIME type used to be reported as `image/x-ms-bmp`, but will be reported as `image/bmp` as of PHP 7.3. Indeed, Microsoft has registered the Windows Image Media Types with IANA.

If your application relies on the verbatim MIME type and potentially has to deal with bitmaps, consider introducing a wrapper function, or make sure the behaviour of your application does not change when another MIME type is returned.

---

Previous: [I/O and Filesystem](https://php7explained.com/backward-incompatible-changes/changed-semantics/io-and-filesystem/index.html.md) | Next: [Operating System](https://php7explained.com/backward-incompatible-changes/changed-semantics/operating-system/index.html.md)
