note 95910 added to function.imagecreatefromwbmp

From: Date: Thu, 28 Jan 2010 11:05:33 +0000
Subject: note 95910 added to function.imagecreatefromwbmp
Groups: php.notes 
Request: Send a blank email to php-notes+get-165403@lists.php.net to get a copy of this message
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); } ?> ---- Server IP: 217.160.72.57 Probable Submitter: 91.64.1.217 ---- Manual Page -- http://www.php.net/manual/en/function.imagecreatefromwbmp.php Edit -- https://master.php.net/note/edit/95910 Del: integrated -- https://master.php.net/note/delete/95910/integrated Del: useless -- https://master.php.net/note/delete/95910/useless Del: bad code -- https://master.php.net/note/delete/95910/bad+code Del: spam -- https://master.php.net/note/delete/95910/spam Del: non-english -- https://master.php.net/note/delete/95910/non-english Del: in docs -- https://master.php.net/note/delete/95910/in+docs Del: other reasons-- https://master.php.net/note/delete/95910 Reject -- https://master.php.net/note/reject/95910 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165403) next »