Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:42:37+00:00 2026-06-04T13:42:37+00:00

I’m stuck at a weird problem regarding imagepng() and similiar. Whatever I do, the

  • 0

I’m stuck at a weird problem regarding imagepng() and similiar.

Whatever I do, the output is disliked by my browser (and my desktop programs) and the image is considered corrupted.

I’ve so far tried

header('Content-Type: image/png');
imagepng(imagecreatefrompng($str_file_path));
exit;

and

header('Content-Type: image/png');
echo file_get_contents($str_file_path, TRUE);exit;

Both gives data which looks like actual image data. Neither should have any blank space since header() doesn’t complain and I exit; the script afterwards.

There are no errors given which would ruin the output either.
The functions are there, obviously. So what seems to be the problem?

I couldn’t find any question answering this either.

The output I get:

�PNG


IHDR�������,����PA����tEXtSoftware�Adobe ImageReadyq�e<
[IDATx��\Mn�Vo?
�Z�L/�پYD>A�'����~�����fo�  �>Aԋ^�Y�*�Z}��|�|�!��$=IZ�$Y,?��\__]�����"������>4?֦��͠��O�H����ze������Dž�æ�:`uEJ��vj�����sSli��v�4��WF�f��������a��g
��)�@��3j�%kЦ�Օ?
ۇ
�saL��~lmujj��Q(&���#�;�6u%7u�MOt�zu��Z������b�8q9�)|}e����c����g:�ӭ��*4TGFs�,y�^`P��=@�+�m���M���z�K�X����Ӥ���D9�ySPu��uq�'��LM�3���
�8?������k�/�����I4�/5�0U�V42��?YPI´4�m�L����gEK2VkM����J�
ͼ3�]i��5�Q�US�~r�e�}�`�P�[0V�/�}�+�8����1�}�V}�1����%
+h�4���U�����ʗ?������m�J+�Ȁlf����"�.pY?�e9��L7�������cA�I��>CG�|�f��Z?�n�':'�;�]��.��;I��$r2χ��.���Ҙy�mA'W�ZT�Iѧ���ӱ]���Y~��?���za�e��A�X�p�ZXA�C0�w�
�ϑ��Յ�(w� ���>�,1���
��9#0�{�AU*:}�I��sG.I���Co�^@�M=�F��ʚ@�S2�j�_c-,����V   ���z��;������9@�    9�BVJ�p���9-�@'��*����Ԛ8��|�g;�C�oX�w8�����͔���{4�*9d�ƙ�L���������a���9�����,�]��3��#W���V;�ML  GFSG~&�k���S�t�?W<���<��i-��5�d:R|�x^P��Tm����M%�/������택w�Oa͎���=jk�}��i{�/;1��Z���/�G�M0d
H��@������V����n-yV��G��P6o��T�Ƿ&��M��m�[9O�f+)E�;�6K|�*s;B�'�c��7I�ՕH�5��� ����]8��V�@���G�3�s�p�Tufl�19�Ԁ+��֭�SKb65MڱÛV��*�(@��ɚ$U��}В7������FW@�lʵ������F~��Z��=`�mv�� ����'�Tj�ME�f�@P�<�>��K<�������1�m�ƕ�AQPRT�o�4��l��0���)�+g�
��[���`�R���)��"eD��b��g��WN-`��i{U�D|(�dhS�0&8K��S���E����Q�x�Ǫ!�K��ܑ�d�O%@c͠d,�,p�(
3t�8T�����:ذ�qߵ�&�y��Ҽ��2�vJ� ���{;>5�J��2`�9��"hC>�%>\�Զ�(fZ�C�]9�ܼaR3w�a"M'�)'�w���p����) ��O^
3�v�/
�VM� _��Q/u�k�э�춏�UGz�/�>IV9�
    �}�@�T�%��{ƚCV�Ǒ��VZ��A�#b�t~��O�@����
�(�8.�|0�
o�C�Ĵ�y�w�xϧr�W��@���O�8+��s��#%�J@V��)V��g�XM�~����G^O]���u~�bA�+�J��y-
�^���k3]y��ok_�[�?Txv��G��ʛx�;���>���1���]8he���z\  ��ď �u��#5�3�g��w~�%$�Z>2����g�Ι�����c�6r�R�\�r%��w���%a)��G@?C�Q@�Ǚ>'��KH��y?�֊V����_��7�����f��Dlv����Kn�D�an�B��ȼ,�ğR��P�,�jC��[�\9��m/��Wȹ����XߣD�J�*�ӧM��~6:��",ҭ@��   ���WL������ވ�P�3,�����i���v37�s��-|,I.)���y_@�K��*��},k�枰v���o�}��w�r�b��R_����L�
��C��I��kP�-�$��?�uZ��r�3�)��lߧ�{�xv~��Ic}�y�Ax׿ᑅZC�U����>�aJ����qc$
���w����e���/���O���ǫ�c�4�\�aB?��҇��9'�X�Tf��K�{MڨG�_I���Hm������s  A��/>?Ś5��B8�Y��a�AO�\��c�Ѿ�՞�O���rܝ�Ur��g���ǚ�T4LZ4�Ga)�5u},����,_�D.���$j��L,�;i=Vm#b����<�ϥ�B���G4��Q���]cY����~�����$�#�ةVH)��7��O[cq�L��Qpwn7/    �|�)-l��hė
D6������Kpw�Gn���Q�:�s�Jwy�%��K�%HJ�KN�Rު��FqB+q${��ZPm������
@;��*>�u�˹
��<���y�G�H]�s-���%Hc%�F�N����/�|�+/���J��t�~�[���/�`��X����IEND�B`�
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:42:39+00:00Added an answer on June 4, 2026 at 1:42 pm

    All credits to @Frits for his comment

    Basicly I had the file saved as UTF-8 when I instead should have had it as UTF-8 without BOM. Changing this solved the problem perfectly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm parsing an XML file, the creators of it stuck in a bunch social
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I used javascript for loading a picture on my website depending on which small
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.