Kairu Posted December 23, 2006 Share Posted December 23, 2006 I guess I'll post the code in it's entirety at the bottom of this post. Basically I'm having trouble with "imagebmp()", while having no trouble with the jpeg, png, or gif equivalents. The only thing I can think of is that the input data is not the proper format? But that should be taken care of when it goes to compile it as a bitmap..... shouldn't it?....[code]<?phpheader('content-type: image/bmp');mysql_connect('localhost:3306', 'User', 'Pass');mysql_select_db('gaia_image');$result = mysql_query('SELECT * FROM data WHERE id = ' . $_GET['id']);$row = mysql_fetch_array($result);$sig = $row[1];$n = $row[2];$image = array(); $avi = array(); $avi_width = array(); $avi_height = array(); $dest_x = array(); $dest_y = array(); $a = array();for ($i=0; $i<=$n; $i++){ array_push($a, $row[(($i * 3) + 3)]);}for ($i=0; $i<=$n-1; $i++){ array_push($avi, imagecreatefrompng($a[$i])); array_push($avi_width, imagesx($avi[$i])); array_push($avi_height, imagesy($avi[$i]));}array_push($image, imagecreatefromstring(file_get_contents($sig)));if ($row[33] != "1"){ array_push($image, imagecreatefromstring(file_get_contents($sig)));}$size = getimagesize($sig);for ($i=0; $i<=$n; $i++){ $temp = "\$temp = " . $row[(($i * 3) + 4)] . ";"; eval($temp); array_push($dest_x , $temp ); $temp = "\$temp = " . $row[(($i * 3) + 5)] . ";"; eval($temp); array_push($dest_y , $temp );}for ($i=0; $i<=$n-1; $i++){ imagecopy($image[0], $avi[$i], $dest_x[$i] , $dest_y[$i], 0, 0, $avi_width[$i], $avi_height[$i]); imagedestroy($avi[$i]);}if ($row[33] != "1"){ imagecopy($image[0], $image[1], 0, 0, 0, 0, $size[0], $size[1]); imagedestroy($image[1]);}imagebmp($image[0]);imagedestroy($image[0]);?>[/code] Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/ Share on other sites More sharing options...
.josh Posted December 23, 2006 Share Posted December 23, 2006 try imagewbmp not imagebmp Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-146787 Share on other sites More sharing options...
Kairu Posted December 23, 2006 Author Share Posted December 23, 2006 Well, it.... I'm not sure what it did... "The image “http://thedarkrealm.no-ip.org/images/0.bmp” cannot be displayed, because it contains errors." It used to just display the URL...... Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-146788 Share on other sites More sharing options...
JasonLewis Posted December 23, 2006 Share Posted December 23, 2006 dosen't those functions require the installation of GD? is it GD... my memory is bad at the moment...run this:[code=php:0]phpinfo();[/code]and look for something about GD... Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-146818 Share on other sites More sharing options...
.josh Posted December 23, 2006 Share Posted December 23, 2006 well he obviously has gd installed, since he said it works for the other image types. if i had to take a guess, the info in your db is off or corrupt somehow, and maybe imagewbmp isn't as forgiving as the other functions. I really can't begin to debug it without having access to the data etc..off topic: i don't really understand why you are doing this:[code]$temp = "\$temp = " . $row[(($i * 3) + 4)] . ";"; eval($temp);[/code]why can't you just do this in the first place:[code]$temp = $row[(($i * 3) + 4)];[/code] Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-146969 Share on other sites More sharing options...
AndyB Posted December 23, 2006 Share Posted December 23, 2006 Check the GD documentation, but as best I recall, bitmap (bmp) files are NOT supported, and wbmp a compressed image format designed for Wireless BitMap, i.e. optimized for mobile computing devices. Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-146986 Share on other sites More sharing options...
Kairu Posted December 24, 2006 Author Share Posted December 24, 2006 [quote author=Crayon Violent link=topic=119711.msg490746#msg490746 date=1166901356]i don't really understand why you are doing this:[code]$temp = "\$temp = " . $row[(($i * 3) + 4)] . ";"; eval($temp);[/code]why can't you just do this in the first place:[code]$temp = $row[(($i * 3) + 4)];[/code][/quote]Quite simple when you look at the data on the database. Some of the cells are formulas instead of numeric values, so placing it in a variable would not return a coordinate. And if the cell contains only numerical data, it still works.@AndyB: Ah! Your correct! Well then.... I guess I can remove bitmap files from the mix.... Thank you! Link to comment https://forums.phpfreaks.com/topic/31665-solved-imagebmp-troubles/#findComment-147214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.