Codesnipp.it Social Code Sharing

My tool

Get DPI from a Image

by My tool on Jun 06, 2011

<?PHP $file = 'test20110429150342063.jpg'; $a = GETIMAGESIZE($file); $bpc = ISSET($a['bits']) ? $a['bits'] : 8; //Read whole file $f = FOPEN($file,'rb'); $data = ''; WHILE(!FEOF($f)) { $data .= FREAD($f,4096); } FCLOSE($f); $dpi = UNPACK('x14/ndpi', $data); print_r($dpi); ?>

Can't see the comments? Please login first :)