I have binary file where is stored image, i try get this image, but display only black color image, what can be wrong with my code or binary file.
<?php
function LoadPNG ($imgname) {
$im = @imagecreatefrompng ($imgname);
if (!$im) {
$im= imagecreate (150, 30);
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc= imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
header('Content-Type: image/png');
$img = LoadPNG('452');
imagepng($img);
imagedestroy($img);
?>
with this code I get I error that can't load file
File: testams.serveriai.lt.lazdynas.serveriai.lt/452 Script: testams.serveriai.lt.lazdynas.serveriai.lt/crypt.php