0

I want to display image from blob mysql data, but image not display, here the code :

$data = $this->Api_m->getData("calon", 'id_calon', $id)->result()[0]->gambar_calon;
    header('Content-Type: image/png');
    imagepng($data); 

image type is png, and when i download from phpmyadmin is work. and because I want to show image in android so i cant use base64 image like this way:

src='data:image/jpeg;base64

Browser screenshot :

screenshot

Wibi Cahyo
  • 39
  • 1
  • 7
  • an empty screenshot is not helpful - the saved data might be. Like what if the image is of a white square .. then it'd have worked. The encoding of the data is essentialy what we'd need to offer any solution. – flowtron Dec 13 '16 at 09:00
  • Don't save files in a database. http://stackoverflow.com/a/38829952/267540 – e4c5 Dec 13 '16 at 09:03

0 Answers0