5
I have a binary image of a blob field and I can’t read it.
In the database it looks like this:
Yes, this is the text image shape.
This is how image:
I tried several things and the only thing that came close to the expected result was:
echo '<img src="data:image/jpeg;base64,'.base64_encode( $result->fields['LOGO'] ).'"/>';
Which resulted in:
Contents of the blob taken from a select:
BM606(@@0``ÿÿÿÿÿÿøøøøøøÿÿÿÿÿÿÿÿÿèèèOOOBBBTTTTTTSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSQQQPPPPPPPPPPPPRRRTTTSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTBBBOOOèèèÿÿÿÿÿÿgggEEE===,,,@@@======@@@+++>>>EEEgggÿÿÿÉÉÉ666+++ 444111111444 ***666ÉÉÉ$$$ ;;;777777;;; $$$ !!!???;;;;;;???""" #GVLqz ¨´gih $$$BBB>>>>>>BBB$$$!+$/J8@cNX{eu® ¿ÌÄ ³³³&&& '''FFFBBBBBBFFF&&&(D2.Z>6dGGqVap¡¬ÁµÐÝÖMOO*N8&K5#9+' %%%´´´ÄÄÄ---)))JJJFFFFFFJJJ((( %"*N7(Z;/`A?mQLqaOcZT[S`c`lmh'L4(a?(_=-`A0F8---ÄÄÄÑÑÑ555+++NNNJJJJJJNNN***)P7%[9+^=;iO5E=:)H$P$M K"O, 9&!A0)b@)dA.eC(5-666ÑÑÑÝÝÝ@@@...RRRMMMMMMRRR---'C2&\:'^<8bL/0)H#^/`3^/X&^/`3_2U, 1E0*iF,fC*gA2aD@@@ÝÝÝèèèKKK000VVVQQQQQQVVV000!*$([<'a=5eJ.1,O'c4`-[&rK%¢rK%[&_,g1J@/M@)N8,kD.jF,B4LLLèèèñññUUU222ZZZUUUUUUZZZ222'F2(d?/gD,@8C!f6m< |d{T5ÈÒÚ{T5|dm< e5K(&$-fC-oG3_CUUUñññúúú]]]555^^^YYYYYY^^^333!+Z<+iB4cJ-$c4n7eAÈÎÕÄÈÊÊÑ×ÃÇÊÊÑ×ÄÈÊÈÎÕe@m5g81$'R;.sI4oJ)1,]]]úúúÿÿÿiii777bbb]]]]]]bbb777,<2,fB/nF-M?=#o>t:u>ÂÀ¾ÍÑפw\6¤wÍÑ×ÂÀ¾u>t:o>E* :01tK4vN?YG iiiÿÿÿÿÿÿxxx"""999gggaaaaaaggg9998YC.mF2qJ)=6H' v>^.µ¤ÖÜã±s4x<s4±ÖÜ㵤_-u=R0#5/1uL4{P@jO"""xxxÿÿÿÿÿÿ%%%===lllffffffmmm>>>&O40rI5uN'84I${<«kèöÿÜàè¦Y}=P}=¦ZÜàèèöÿ¬ky;T/%613zO7S9fJ%%%ÿÿÿÿÿÿ(((@@@sssllllllsss???2Z@2vK5xO)<6J) IZ¯cãéîÌÀ²H@HÌÀ²ãéî¯cZHR1#:25R:WHlV***ÿÿÿÿÿÿ,,, !!! !!! !!! !!! !!!!!!CCCxxxqqqqqqxxxCCC6N>3wL5|P/K?8"JS\ßÝÛìôþÕɺº~ÕɺìôýßÝÛ\SJA+%J98W=Z;KA---ÿÿÿÿÿÿ©©©000 ###### """"""!!!!!!""""""""" ###"""!!! """$$$""" """!!!!!!FFF{{{tttttt{{{FFF '.*3rJ5R7fJ) i;WµLñøÿäáÛðõûð÷þðõûäáÛñøÿµLUo?2,,2pL;\?}X)))111©©©ÿÿÿÿÿÿµµµ444 !!!"""#########$$$"""###!!!!!!###""""""""""""###"""!!!$$$"""###$$$"""###GGGyyyyyyGGG###$##3bD7T9~S+63;"I¯fºE¦bÌ«ÿÿÿÌ«¦bºEdIG-)C8;Y=_?fM""" 444¶¶¶ÿÿÿÿÿÿÀÀÀ888!!!###$$$$$$%%%%%%%%%######"""$$$%%%$$$$$$###$$$$$$$$$$$$%%%$$$%%%%%%$$$###KKK~~~~~~JJJ$$$$$$/D77S9W9hK,TDII(I±f²e¹zÒªn¹z²e°dMT3/648T>bDa183### 888¿¿¿ÿÿÿÿÿÿËËË;;;"""&&&%%%%%%%%%%%%%%%&&&((($$$%%%%%%%%%%%%%%%$$$%%%&&&%%%%%%%%%%%%$$$%%%(((LLLLLL&&&%%%(((6oK:Y9U9X<[HB$r?Y¨b¦[§aYuB I-187:{V@dAdAdN$$$&&&$$$<<<ÊÊÊÿÿÿÿÿÿÔÔÔ@@@%%%&&&&&&&&&((('''((('''((((((%%%&&&&&&&&&&&&''')))''''''%%%'''''''''''''''PPPPPP'''&&&&&&0=58T;[<Y9bI'''3*%C*N)S+ U/H-9316SF@]C hBgI~\,*+''''''%%%AAAÕÕÕÿÿÿÿÿÿÞÞÞDDD$$$'''((('''(((((())))))(((((()))(((((((((((()))'''&&&((('''((()))))))))'''@@@jjjeeeeeekkk???$$$'''(((3N<:U<Z;[AwT''' ¶¯j|uYkbMf[Fr_IfIkG¦lE¡iH]222((())))))%%%EEEÞÞÞÿÿÿÿÿÿçççJJJ&&&(((***+++***))))))+++((()))***+++***)))++++++)))(((***+++***)))***!!!OOO¹¹¹³³³²²²µµµµµµ²²²³³³¹¹¹LLL ***-1.0834J<9fI8fIGJHÎäÖºÞÈϱÀkµ\°}R®vL¨pJjCjR/,.******)))***'''JJJæææÿÿÿÿÿÿîîîUUU)))+++***+++***++++++++++++---+++)))+++++++++,,,***++++++***+++***+++!!!XXXÞÞÞØØØÍÍÍÃÃÃÃÃÃÍÍÍ×××ÝÝÝXXX ***+++)))+++,,,***rxt±Æ¹¦Í´Ç¥w¼g³Y¨wNgCoT7?:***+++******++++++)))WWWíííÿÿÿÿÿÿóóó___+++---,,,+++---,,,...,,,***---,,,+++,,,...---,,,+++---...+++,,,,,,---!!!WWWÚÚÚÔÔÔÄÄÄÃÃÃÃÃÃÄÄÄÓÓÓÙÙÙXXX$$$,,,,,,,,,,,,---++++++9:9U\Wh~po{[yeCRH000,,,------+++,,,,,,...++++++aaaóóóÿÿÿÿÿÿùùùjjj---------...000---...///............///......///------------111---...$$$^^^ãããØØØÙÙÙïïïîîîÙÙÙ×××âââ\\\###,,,//////---//////............000///......---------...000---...---000kkkøøøÿÿÿÿÿÿýýýsss222///...///000/////////111///000///000000//////111000///...000//////###MMMÌÌÌ¿¿¿ÅÅÅÖÖÖÖÖÖÅÅÅÀÀÀËËËLLL$$$...000000/////////000///000000000000...///111000...///000//////...333tttýýýÿÿÿÿÿÿÿÿÿ666000222222///111111111111222111111333111111111111222222222000111111111hhheee000111111///222222111111222111222222000111111111222222222000111111///666ÿÿÿÿÿÿÿÿÿÿÿÿ222000111111111111222000000111111222222222333333111222111111111111...:::ÆÆÆÑÑÑÌÌÌÊÊÊÉÉÉÇÇÇÇÇÇÆÆÆÊÊʾ¾¾999...111111222111111000222222222333111333222222222111111111111222...222ÿÿÿÿÿÿÿÿÿÛÛÛWWWIIIJJJIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHHHIIIIIIIIIIIIJJJIIIIIIIIIIIIEEEQQQÛÛÛäääÞÞÞÝÝÝÜÜÜÛÛÛÚÚÚÙÙÙÝÝÝÒÒÒQQQFFFIIIIIIIIIIIIIIIIIIIIIIIIHHHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIHHHHHHWWWÛÛÛÿÿÿõõõkkk888ÁÁÁ÷÷÷ïïïîîîíííííííííìììòòò»»»888kkkõõõ¢¢¢999PPPöööîîîììììììììììììîîîöööPPP999¢¢¢^^^+++UUUùùùñññïïïîîîîîîîîîðððøøøUUU+++]]]PPP&&& ZZZÿÿÿøøøõõõõõõôôôóóó÷÷÷ÿÿÿZZZ !!! &&&QQQaaa&&& !!!""""""""""""!!!###!!!"""""""""!!!!!!"""###!!! """"""""""""!!!"""ZZZøøøöööõõõôôôôôôõõõõõõ÷÷÷ZZZ!!!!!!""""""###!!!""""""!!! !!!"""###!!!!!!""""""!!!"""!!!"""!!!"""!!!&&&bbbwww((("""###$$$$$$######$$$############$$$""""""$$$############$$$######$$$###!!!---AAAiiihhhAAA---!!!$$$"""$$$$$$###$$$"""############$$$######"""$$$#########$$$######$$$!!!(((www+++$$$$$$%%%&&&%%%%%%&&&%%%%%%$$$$$$%%%%%%%%%$$$%%%%%%%%%$$$&&&%%%%%%&&&%%%&&&"""DDD||||||FFF!!!'''%%%%%%&&&%%%%%%&&&$$$$$$%%%$$$%%%$$$%%%&&&$$$%%%%%%%%%&&&&&&%%%%%%$$$"""+++///%%%''''''((('''(((''''''&&&&&&'''((('''''''''''''''((('''''''''''''''''''''&&&PPPPPP'''((('''''''''&&&'''&&&&&&'''((('''''''''''''''''''''(((''''''''''''&&&&&&&&&...¯¯¯333''')))))))))***))))))***+++)))))))))((())))))((())))))))))))***)))*********))) TTTTTT!!!))))))))))))))))))******))))))((())))))))))))***)))))))))***)))))))))***)))'''333°°°½½½;;;***++++++***,,,,,,,,,+++,,,,,,,,,,,,++++++,,,,,,,,,+++***+++,,,---,,,+++,,,,,,###YYY ZZZ###+++***+++,,,,,,+++,,,,,,,,,,,,+++***++++++---,,,+++******,,,,,,,,,+++,,,,,,***999½½½ÉÉÉAAA+++,,,............//////---............///.........,,,---...///......///...---%%%aaa¬¬¬££££££aaa###---............//////......///...///...//////---,,,---............///......---@@@ÉÉÉÕÕÕGGG///000111111111111000111000111111111111000111111111///111111111000000000111111'''iii»»»±±±±±±»»»hhh%%%000111111000000000111000111000222111///111111111000111111111000000111000000///GGGÕÕÕàààTTT555888777777777777888888666888777666666777888777666888777777888777777888666888---qqqÉÉɾ¾¾¾¾¾ÉÉÉqqq,,,888777777666777888777777888777666777888888777777999777777777666888888666888666UUUáááëëëiiiBBBFFFGGGEEEFFFEEEFFFFFFDDDFFFFFFEEEFFFGGGFFFEEEDDDEEEGGGDDDFFFEEEFFFFFFDDDEEE;;;~~~ÖÖÖËËËËËËÖÖÖ~~~999GGGEEEEEEFFFFFFFFFEEEEEEFFFEEEDDDFFFFFFFFFEEEDDDFFFFFFEEEFFFEEEFFFFFFDDDFFFCCCiiiìììôôôVVVXXXVVVVVVZZZVVVXXXYYYXXXWWWWWWWWWXXXXXXXXXWWWXXXWWWWWWUUUYYYWWWWWWYYYYYYWWWLLLâââ××××××âââMMMWWWUUUXXXYYYVVVXXXXXXWWWWWWWWWWWWXXXXXXXXXWWWWWWXXXVVVWWWYYYVVVXXXXXXYYYWWWVVVôôôûûûiiijjjiiijjjiiiiiijjjiiikkkjjjjjjjjjjjjhhhhhhhhhkkkkkkjjjjjjiiiiiiiiiiiijjjkkk___êêêààààààêêêbbbkkkjjjjjjiiijjjiiiiiikkkiiijjjkkkiiiiiigggiiikkkjjjiiijjjiiiiiiiiihhhjjjjjjhhhûûûÿÿÿ¥¥¥xxxzzz{{{zzzxxxyyy|||xxxxxx{{{zzzyyy|||zzz{{{zzzyyy{{{{{{zzzyyywww{{{yyywwwyyyppp¥¥¥ïïïææææææïï襤¤ppp{{{{{{zzzwwwzzzzzzxxxyyyzzzyyyzzz|||zzz|||yyyyyyzzzzzzzzzxxxyyy{{{xxxwwwzzzxxx¦¦¦ÿÿÿÿÿÿ²²²}}}¬¬¬ñññééééééñññ¬¬¬²²²ÿÿÿÿÿÿ¹¹¹íííååååååììì°°°¹¹¹ÿÿÿÿÿÿººº¥¥¥áááÚÚÚÚÚÚáá᧧§~~~ºººÿÿÿÿÿÿÅÅÅpppmmmooonnnmmmmmmnnnmmmnnnoooooolllnnnmmmlllooonnnnnnnnnooolllnnnmmmmmmmmmooohhhÏÏÏÈÈÈÈÈÈÏÏÏeeemmmnnnmmmnnnmmmmmmllloooooonnnllloookkkmmmooommmmmmnnnnnnmmmnnnnnnlllnnnnnnrrrÅÅÅÿÿÿÿÿÿííí]]]MMMOOOOOOQQQOOOMMMQQQMMMMMMOOOOOOOOONNNNNNOOOOOONNNOOOOOOPPPPPPMMMPPPOOOMMMGGG{{{ººº²²²²²²ºººzzzFFFNNNOOOPPPQQQMMMNNNPPPLLLNNNOOONNNNNNNNNNNNPPPOOONNNOOOOOOPPPOOOMMMQQQMMMLLL]]]îîîÿÿÿÿÿÿÿÿÿ¼¼¼666---............---...///......///...,,,,,,,,,------++++++//////------///%%%___££££££^^^%%%...---///...///******------------...---------...///---......///...---...666¼¼¼ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿËËËlllNNNMMMNNNMMMMMMNNNNNNMMMRRRCCC!!!!!!!!! !!! !!!$$$IIIQQQNNNNNNOOOFFFwww±±±ªªªªªª±±±wwwGGGOOONNNNNNQQQJJJ### !!! !!! !!!CCCRRRMMMNNNNNNNNNNNNOOONNNMMMlllËËËÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿëëëzzz||||||}}}qqq|||õõõÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõõõ|||qqq~~~||||||zzzëëëÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿéééåååÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåååéééÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÙÙÙRRRHHH\\\hhhsss{{{{{{sssiii]]]HHHSSSÚÚÚÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ§§§¤¤¤EEE111222000///...------,,,,,,------...///000111000EEE¤¤¤¨¨¨ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¢¢¢mmm```dddfffgggiiijjjjjjkkkjjjjjjjjjiiigggeeeccc```mmm¢¢¢ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿùùù¼¼¼lllYYYYYYUUUTTTRRRRRRRRRQQQQQQPPPQQQRRRSSSUUUXXXYYYjjj¼¼¼ùùùÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðððãããÛÛÛÔÔÔÎÎÎÉÉÉÇÇÇÃÃÃÁÁÁÁÁÁÂÂÂÃÃÃÈÈÈÍÍÍÔÔÔÛÛÛãããïïïÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
How can I read this image correctly in php?
When you save her from Base64? when displaying would not be Decode?
– rray
I didn’t save her, I just read, I asked a developer from Delphi, who saves this image, he said he uses a component for this and he doesn’t know about her internal process, see if he can ? what I know he is a binary type blob field.
– Gabriel Rodrigues
and Code and Pure do not work?
– rray
Can extract binary content from the database and post it as well?
– Luis Henrique
@rray neither of the two forms, Luis updated the question with the contents
– Gabriel Rodrigues
I would recommend you to make an HTTP call to load the image, I already did the way you showed it with a large image, and it was bad for the browser to render the page.
– Giancarlo Abel Giulian
@Giancarloabelgiulian as well ?
– Gabriel Rodrigues
I created an answer to that
– Giancarlo Abel Giulian