/ Published in: PHP
Since PHP doesn't have a builtin imagecreatefrombmp, this allows users to upload bmp files and you can handle them and create a different image type from it.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * Creates function imagecreatefrombmp, since PHP doesn't have one * @return resource An image identifier, similar to imagecreatefrompng * @param string $filename Path to the BMP image * @see imagecreatefrompng * @author Glen Solsberry <[email protected]> */ function imagecreatefrombmp( $filename ) { { } $hex = $temp[1]; { // Remove some stuff? // Get the width // Remove some stuff? // Get the height } $x = 0; $y = 1; foreach( $body as $rgb ) { $x++; if( $x >= $width ) { $x = 0; $y++; } } return $image; } }