Re: Odd Request: Image 2 HEX

From: Date: Tue, 09 Jul 2002 17:13:10 +0000
Subject: Re: Odd Request: Image 2 HEX
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-106397@lists.php.net to get a copy of this message
$hFile = fopen($PathToFile,'r'); $File = fread($hFile, $SizeOfLargestImageYouHave); fclose($hFile); $HexVal = bin2hex($File); This doesn't do any error checking or stripping of image headers that may be necessary; you'll have to use string functions (eg; substr() or maybe regexps) to do that. For more info, see: http://www.php.net/manual/en/function.fopen.php http://www.php.net/manual/en/function.fread.php http://www.php.net/manual/en/function.bin2hex.php -steve At 9:08 AM -0700 7/9/02, JSheble wrote:
I'm using a Zebra label printer in an application I have and in order to display an image on the label, according to the ZPL II printer language, any image must be converted to HEX code. Does anyone hvae a code snippet or know of a free utility that will take a graphic image (BMP, GIF, JPG, etc...) and convert it to HEX values? Thanx...
-- +------------------------------------------------------------------------+ | Steve Edberg sbedberg@ucdavis.edu | | University of California, Davis (530)754-9127 | | Programming/Database/SysAdmin http://pgfsun.ucdavis.edu/ | +------------------------------------------------------------------------+ | The end to politics as usual: | | The Monster Raving Loony Party (http://www.omrlp.com/) | +------------------------------------------------------------------------+

« previous php.general (#106397) next »