Rikter 0 Posted September 3, 2014 I'm asking for help to any webdeveloper, as I'm not used to that side of programming.I'm trying to show a given emblem on a test site, passing the emblem_data field from sql database.I tried to "isolate" code from Flux for function to show the emblem, but failed. Is there someone that can suggest me a clean code for that?Thanks :3 Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted September 4, 2014 Try programming it so that it grabs the image from the URL directly: <img src='url/of/your/logo/creator.php?logo=id'> Quote Share this post Link to post Share on other sites
0 kisuka 178 Posted September 3, 2014 No idea if this will work. <?phpecho '<img src="data:image/jpeg;base64,'.base64_encode($emblem_data).'">';?> Can't test it at the moment as I'm not at a computer atm. But basically the value stored in MySQL is a binary / BLOB of the image. Or you can use GD library's imagecreatefrombmpstring() function. Quote Share this post Link to post Share on other sites
0 Rikter 0 Posted September 4, 2014 I managed to make it work with imagecreatefrombmpstring() fetched from FluxCP, but I've got the problem that it worked on a standalone page, but didn't work when integrating in another page. I think that's due to that function using imagepng to get the image, that requires the declaration in header for the content image/png. I'll try to use the same function, but show the image wit the code you gave me, as testing it with that code alone returns the string but can't elaborate it as image, thanks Quote Share this post Link to post Share on other sites
0 Rikter 0 Posted September 4, 2014 That's an idea that I didn't think off, I'll try it as soon as I'll be at home, thanks Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted September 4, 2014 That's an idea that I didn't think off, I'll try it as soon as I'll be at home, thanks Why don't you try the FluxCP's module for that? modules/guild contains emblem.php, while index.php outputs it. Quote Share this post Link to post Share on other sites
0 Rikter 0 Posted September 4, 2014 'cause I have my own coded website thanks to Yommy, and I prefer that over Flux Anyway, I managed to make it works!For anyone who may need to know how, I used the imagecreatefrombmpstring() function with call for it on the same php page, and recalled that page with "<img src='url/of/your/logo/creator.php?logo=id'>" as suggested by Jabote Thanks everyone for the help ^^ Quote Share this post Link to post Share on other sites
I'm asking for help to any webdeveloper, as I'm not used to that side of programming.
I'm trying to show a given emblem on a test site, passing the emblem_data field from sql database.
I tried to "isolate" code from Flux for function to show the emblem, but failed. Is there someone that can suggest me a clean code for that?
Thanks :3
Share this post
Link to post
Share on other sites