I'm trying to create a script that pulls an image out of the database and displays it to the user, called by <img src="viewImage/someImageName">
But the problem I'm having is when the image is displayed all of the Nulls (0x00) are replaced by 0x20 and I have no idea why. The data in the database shows it being nulls but somewhere along the way it gets changed to 0x20s.
Does anyone have any idea? is there something I'm missing?
Here is the code I'm using:
$data = $this->Image->read(NULL, $userId);
header("Content-Type: image/jpeg");
echo($data['image']);
die;
I don't think it has anything to do with the code because as you can see there is no place for error. I can dump the binary contents out and it has not yet been tampered.
Something with the stack or cakephp any thoughts?
Update: I've noticed that a space is making to the beginning of stream, I'm trying to track it down, could this be the problem?