tags:

views:

22

answers:

2

iam get the img date from the zip archive by getFromIndex() and the date like that (this the first line of text appearing)

‰PNG  ��� IHDR���@���@���ªi

know how i can makke appear iam used

$im = imagecreatefromstring($data);
if ($im !== false) {
    header('Content-Type: image/png');
    imagepng($im);
    imagedestroy($im);
} 

but its did not worked and used

header('Content-Type: image/png');
imagepng($data);
imagedestroy($im);

but its did not worked and giving me Warning: imagepng(): supplied argument is not a valid Image resource

now you asked me about the date format we assume the output is

$date =  file_get_contents('http://sstatic.net/so/img/logo.png');

the text appear is the same format but i must use $date because i must get the contents first

+1  A: 

I suspect this image data is not the only output of this script, right? But it must be.

Col. Shrapnel
$date = file_get_contents('http://sstatic.net/so/img/logo.png');
moustafa
@moustafa so what? can you answer my question? is it the only data your script outputs? can you post here the whole script code?
Col. Shrapnel
A: 

The data already looks like a PNG file (notice the magic number). What happens if you output the data to a file ? Or How about just echo the data and don't call imagepng. Will that work ?

nc3b
no it doesnt work
Col. Shrapnel
try using $date = file_get_contents('http://sstatic.net/so/img/logo.png');
moustafa