I've built a function on class Image that retrieves or should retrieve me the image in a binary format. However I just get the error icon when I call that controller method.
I need this done this way, because the images are being sent to an iOS and Android app.
The path of the image is correct (I've double checked it)
I'm using CodeIgniter 2.1.3 and my code looks like this
$images = $this->image->getImageById($database,$id);
$data = fopen($images->path, 'rb');
header('Content-type: image/jpeg');
fpassthru($data);
Any idea on how can I achieve this?
Thank you