Jump to content
iwato

Image Capture and Display

Recommended Posts

BACKGROUND:  With a mixture of melancholy reluctance and what-else-to-do excitement I have returned to Matomo and managed to extract what appears to be an image.  In effect, I am echoing a cUR result set that appears as follows:

�PNG  IHDR "�E! pHYs���+�IDATx���}�E����ٙ�K6�n ل���DP�FT�_��r���;ėS<���;.���E��D�<5'QP ��o �I��IV6�dC�n6��f6;3}4M���LW������L�Tw��2����J�u]@�L� H�b,�X��#`(F�����v�B۷\�!#`%OWWרo���+�� ...

My intuition -- I am sorry, if I can offer little more at this point -- tells me that I could read the contents of this file with the simple addition of a document heading.  If so, what might this heading be. If not, what would you suggest?

Please advise.

Roddy

Share this post


Link to post
Share on other sites

If that is the only output of your script then you can make the browser interpret it as an image by sending a content-type header:

header('Content-type: image/png');
echo $image_content;

If you try to print anything else, like HTML or even just spaces and line breaks, then the image will appear corrupted in the browser.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...