Magictallguy Posted August 27, 2020 Share Posted August 27, 2020 Example implementation: 2020-08-27_09-25-22.mp4 3 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 27, 2020 Author Share Posted August 27, 2020 (edited) I have this so far. Working on the Download part atm which is getting me for the moment. I might have it just update the display_pic in users settings or both. Edited August 29, 2020 by peterisgb Latest Screenshot 3 Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 27, 2020 Share Posted August 27, 2020 Looking good both @Magictallguy @peterisgb Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 27, 2020 Author Share Posted August 27, 2020 Me and magictallguy have been working on the mccodes avataaar for most of today. V1.0.1 will hopefully be on the market place later tonight once the final touches are done. 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted August 28, 2020 Share Posted August 28, 2020 (edited) Force download with imagelng/imagegif or even file_get_contents ? Im sure you are also aware of changing the header of pages? Can change to image to force it to pop up as download? Edited August 28, 2020 by Sim Quote Link to comment Share on other sites More sharing options...
PHPStudent Posted August 28, 2020 Share Posted August 28, 2020 (edited) Looks amazing. Edited August 28, 2020 by PHPStudent 1 Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted August 28, 2020 Share Posted August 28, 2020 6 hours ago, Sim said: Force download with imagelng/imagegif or even file_get_contents ? Im sure you are also aware of changing the header of pages? Can change to image to force it to pop up as download? The original image is an SVG. PHP doesn't have any native image handling libraries and GD (usually compiled with PHP by default these days) can't support the SVG format. If you've got Imagick installed, then you're good to go. If not, then I recommend a 3rd party service such as CloudConvert, they have an API exposed (in a format you're more accustomed to, Sim) that allows you to convert on-demand from within your own site. Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 28, 2020 Share Posted August 28, 2020 (edited) 3 hours ago, Magictallguy said: The original image is an SVG. PHP doesn't have any native image handling libraries and GD (usually compiled with PHP by default these days) can't support the SVG format. If you've got Imagick installed, then you're good to go. If not, then I recommend a 3rd party service such as CloudConvert, they have an API exposed (in a format you're more accustomed to, Sim) that allows you to convert on-demand from within your own site. Do you store the raw SVG data? or the link to the image based on the options supplied? Could you do something like: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It's been a really loooong time, so if I'm way off, sorry 🙂 Edit: Realised SVGs aren't useful to the normal folk for use as images, scrap the above. Edited August 28, 2020 by Djkanna 1 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 28, 2020 Author Share Posted August 28, 2020 The avatar system is ready. Due to the time and work done both by me and my I've released it on the paid market place. With my update checker to check version. Quote Link to comment Share on other sites More sharing options...
Sim Posted August 28, 2020 Share Posted August 28, 2020 Congrats on release. Is your update checker released? Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 28, 2020 Author Share Posted August 28, 2020 1 hour ago, Sim said: Congrats on release. Is your update checker released? Yup. Update checker is available across all my mods. Quote Link to comment Share on other sites More sharing options...
Sim Posted August 29, 2020 Share Posted August 29, 2020 5 hours ago, peterisgb said: Yup. Update checker is available across all my mods. Is it possible to get the source to add to mines? Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted August 29, 2020 Share Posted August 29, 2020 10 hours ago, peterisgb said: Yup. Update checker is available across all my mods. Not quite what he was asking. He's after the brain bit behind it (the bit on your site) 1 Quote Link to comment Share on other sites More sharing options...
peterisgb Posted August 29, 2020 Author Share Posted August 29, 2020 (edited) 6 hours ago, Sim said: Is it possible to get the source to add to mines? Oh, Nope sorry, Its all inhouse to my mods only. Welcome to take the idea and build your own. I may in the future once my system is set up fully to allow users to use it, but that wont be till new year at the Earliest. Edited August 29, 2020 by peterisgb Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 30, 2020 Share Posted August 30, 2020 (edited) On 8/28/2020 at 3:16 PM, Djkanna said: Do you store the raw SVG data? or the link to the image based on the options supplied? Could you do something like: $img = file_get_contents ( 'https://avataaars.io/?avatarStyle=Circle&topType=LongHairStraight&accessoriesType=Blank&hairColor=BrownDark&facialHairType=Blank&clotheType=BlazerShirt&eyeType=Default&eyebrowType=Default&mouthType=Default&skinColor=Light%27' ); if ( $img ) { header( 'Content-type: image/svg+xml' ); header( 'Content-Disposition: attachment; filename=avatar_download.svg' ); echo $img; } You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. It's been a really loooong time, so if I'm way off, sorry 🙂 Edit: Realised SVGs aren't useful to the normal folk for use as images, scrap the above. Wasn't letting it get the best of me after a little browsing/trial and error, providing you use the SVG as the image preview - Pure JS method of download SVG as png. 🙂 *Works in most decent browsers, the 'download' attribute is hit and miss. https://codepen.io/MrDJK/pen/ZEWyPMa Alternatively, combine both solutions: instead of creating download link do*: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. *Probably have to increase the URI limit, or do post request instead of get. Edited August 30, 2020 by Djkanna Cannot spell. - 2nd: Added alternative 3 Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted August 31, 2020 Share Posted August 31, 2020 16 hours ago, Djkanna said: Wasn't letting it get the best of me after a little browsing/trial and error, providing you use the SVG as the image preview - Pure JS method of download SVG as png. 🙂 *Works in most decent browsers, the 'download' attribute is hit and miss. https://codepen.io/MrDJK/pen/ZEWyPMa Alternatively, combine both solutions: instead of creating download link do*: window.location.href = 'download.php?img='+dataURL.replace('data:image/png;base64,', ''); You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. if ( $_GET['img'] ) { header( 'Content-type: image/png' ); header( 'Content-Disposition: attachment; filename=avatar_download.png' ); echo $_GET['img']; } You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. *Probably have to increase the URI limit, or do post request instead of get. Heh, we ended up doing something quite similar. Nicely done! 🙂 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.