note 95910 deleted from function.imagecreatefromwbmp by cmb
| From: | cmb@php.net | Date: | Sun, 19 May 2019 16:01:13 +0000 |
| Subject: | note 95910 deleted from function.imagecreatefromwbmp by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-211065@lists.php.net to get a copy of this message | ||
Note Submitter: php at webdecker dot de
----
To get the horizontal and vertical resolution you could add some lines to the previous code of
alexander. BMP stores the resolution in pixels per meter. To get it as pixels per inch (dpi) you
have to multiply the value by 0.0254.
<?php
public function imagecreatefrombmp($p_sFile)
{
// ...
// ... insert after the lines where you get width and height...
// Get the horz. resolution in pixel per meter, 4 bytes
$dpix = hexdec($header_parts[39]. $header_parts[38]) * 0.0254;
// Get the vert. resolution in pixel per meter, 4 bytes
$dpiy = hexdec($header_parts[43]. $header_parts[42]) * 0.0254;
// ... rest of the code...
return ($image, $dpix, $dpiy);
}
?>