{"id":67858,"date":"2025-04-02T03:01:00","date_gmt":"2025-04-01T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=67858"},"modified":"2025-04-04T08:09:15","modified_gmt":"2025-04-03T22:09:15","slug":"audio-card-background-image-quality-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-background-image-quality-tutorial\/","title":{"rendered":"Audio Card Background Image Quality Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Audio Card Background Image Quality Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card_take_photo.png\" title=\"Audio Card Background Image Quality Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Audio Card Background Image Quality Tutorial<\/p><\/div>\n<p>This current project may be about <a target=\"_blank\" title='YouTube' href='http:\/\/youtube.com' rel=\"noopener\">YouTube<\/a> basis &#8220;audio cards&#8221;, but inevitably, if we offer background image possibilities, some users may turn it&#8217;s functionality, more, into a &#8220;postcard&#8221; feeling presentation.   But, with yesterday&#8217;s <a title='Audio Card Circular Wording Text Tutorial' href='#accwtt'>Audio Card Circular Wording Text Tutorial<\/a> only a much restricted range of image elements could be handled because of the amount of data involved, whether that be because of &#8230;<\/p>\n<ul>\n<li>density of pixels &#8230; and\/or &#8230;<\/li>\n<li>dimensions &#8230; for instance, a Take Photo dimension on our iPhone results in an image of more than 3000&#215;2000 &#8230; which is not going to fly<\/li>\n<\/ul>\n<p> &#8230; and so, except for GIFs we reduce to JPEGs of potentially lower quality via the HTML5 canvas ( ie. &lt;canvas id=canvaselement style=display:none;&gt;&lt;\/canvas&gt; ) using &#8230;<\/p>\n<p><code><br \/>\n  function reduceimsize() {<br \/>\n    var imgl=new Image();<br \/>\n<br \/> <br \/>\n    imgl.onload = function() {<br \/>\n      var c = document.getElementById('canvaselement'); \/\/querySelector('canvas'), \/\/ see Example 4<br \/>\n      var factor=1.0;<br \/>\n      var propw=eval('' + imgl.width);<br \/>\n      var proph=eval('' + imgl.height);<br \/>\n      while (propw &gt; 1000 || proph &gt; 1000) {<br \/>\n        propw=eval(0.9 * propw);<br \/>\n        proph=eval(0.9 * proph);<br \/>\n      }<br \/>\n      c.width = propw;<br \/>\n      c.height = proph;<br \/>\n      var ctx = c.getContext('2d');<br \/>\n      if (propw == eval('' + imgl.width) && proph == eval('' + imgl.height)) {<br \/>\n      ctx.drawImage(imgl, 0, 0);<br \/>\n      } else {<br \/>\n      ctx.drawImage(imgl, 0, 0, eval('' + imgl.width), eval('' + imgl.height), 0, 0, propw, proph);<br \/>\n      }<br \/>\n      twocontocont=c.toDataURL('image\/jpeg',0.5).replace(\";base64,\",\";charset=utf-8;base64,\").replace(\/^daXta:image\\\/(png|jpg|jpeg);base64,\/, \"\");<br \/>\n      document.getElementById('background').value=twocontocont;<br \/>\n    };<br \/>\n<br \/> <br \/>\n    imgl.src = twocontocont;<br \/>\n  }<br \/>\n<\/code><\/p>\n<p> &#8230; allowing for many more image scenarios, including the iPhone Camera app &#8220;Take Photo&#8221; one, to start working.  Bit more like a &#8220;postcard&#8221; now?!<\/p>\n<p>We also thought the one mandatory textbox should be up the top, and so we made that happen, today.<\/p>\n<p>And for the first time we can remember we handled some yellow background colour to the &#8220;clicking&#8221; parts of the form&#8217;s left hand side, via &#8230;<\/p>\n<p><code><br \/>\n&lt;div id=divyellow style=z-index:-456;background-color:yellow;&gt;&lt;\/div&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; accessed via document.body &#8220;onload&#8221; event logic &#8230;<\/p>\n<p><code><br \/>\n&lt;body onload='checkdiv(); setInterval(checkdiv,10000);'&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; calling &#8230;<\/p>\n<p><code><br \/>\n  function checkdiv() {<br \/>\n    var trrect=document.getElementById('oversee').getBoundingClientRect();<br \/>\n    var mrrect=document.getElementById('cbi').getBoundingClientRect();<br \/>\n    var bbrect=document.getElementById('bab').getBoundingClientRect();<br \/>\n    document.getElementById('divyellow').style.position='absolute';<br \/>\n    document.getElementById('divyellow').style.top='' + eval(-3 + trrect.top) + 'px';<br \/>\n    document.getElementById('divyellow').style.left='' + eval(-3 + trrect.left) + 'px';<br \/>\n    document.getElementById('divyellow').style.width='' + eval(6 + mrrect.width) + 'px';<br \/>\n    document.getElementById('divyellow').style.height='' + eval(6 + eval(bbrect.bottom - trrect.top)) + 'px';<br \/>\n  }<br \/>\n<\/code><\/p>\n<p> &#8230; the <strike>overlay<\/strike>underlay hugely negative CSS <i>z-index<\/i> property the key to its aesthetic, but no other <font size=1>(as pleases us greatly)<\/font>, talents, in <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html--GETME\" rel=\"noopener\">our third  draft<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html--GETME\" rel=\"noopener\">audio_card.html<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\">Audio Card creator<\/a>.<\/p>\n<p>Oddly, an earlier more straightforward approach of involving an HTML table element to this idea stuffed up the alignment of the created Audio Cards <font size=1>&#8230; very odd?!<\/font><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-background-image-quality-tutorial\/' rel=\"noopener\">Audio Card Background Image Quality Tutorial<\/a>.<\/p-->\n<hr>\n<p id='accwtt'>Previous relevant <a target=\"_blank\" title='Audio Card Circular Wording Text Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-circular-wording-text-tutorial\/' rel=\"noopener\">Audio Card Circular Wording Text Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Audio Card Circular Wording Text Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card_cwt.gif\" title=\"Audio Card Circular Wording Text Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Audio Card Circular Wording Text Tutorial<\/p><\/div>\n<p>Yesterday&#8217;s <a title='Audio Card Primer Tutorial' href='#acpt'>Audio Card Primer Tutorial<\/a> offered a <b><i>&#8230;<\/i><\/b> means of delimiting any optional Audio Card text wording as entered by the user, but as of today it means more because &#8230;<\/p>\n<ul>\n<li>we start supplying a <a target=\"_blank\" title='YouTube' href='http:\/\/youtube.com' rel=\"noopener\">YouTube<\/a> supplied title as the wording more often <font size=1>(ie. until you ever use the keyboard in that topmost textbox, detected via the <i>onkeydown<\/i> event)<\/font> &#8230; though when this happens the <b><i>&#8230;<\/i><\/b> is usually not there &#8230; and so &#8230;<\/li>\n<li>when the user adds in a <b><i>&#8230;<\/i><\/b> delimiter to the Audio Card wording text, that now &#8230;<\/li>\n<li>results in any prefixing wording parts before the <b><i>&#8230;<\/i><\/b> be shown as Circular Text &#8230; and regarding the circle that creates &#8230;<\/li>\n<li>any background image will apply to, in order of priority &#8230;\n<ol>\n<li>the circle, as above, background image &#8230; or &#8230;<\/li>\n<li>body background image<\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<p> &#8230; and, for your auditory learners with a slight visual &#8220;bent&#8221;, maybe that background imagery could be an animated GIF <font size=1>(which can be an aid to concentration, we find, if the right style of animated GIF is selected &#8230; we found today&#8217;s presentation one at <a target=\"_blank\" title='https:\/\/au.pinterest.com\/pin\/316096467588365493\/' href='https:\/\/au.pinterest.com\/pin\/316096467588365493\/' rel=\"noopener\">https:\/\/au.pinterest.com\/pin\/316096467588365493\/<\/a>, thanks)<\/font>.  Might sound strange, but preparing for a trip, aren&#8217;t you more interested in the auditory advice, rather than spoiling the anticipation seeing everything ahead of <i>actually<\/i> seeing it <font size=1>&#8230; hopefully!<\/font>?<\/p>\n<p>So this <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html-GETME\" rel=\"noopener\">second draft<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html-GETME\" rel=\"noopener\">audio_card.html<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\">Audio Card creator<\/a> helped out by <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/circular_text.html------------------GETME\" rel=\"noopener\">a changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/circular_text.html------------------GETME\" rel=\"noopener\">circular_text.html<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/circular_text.html\" rel=\"noopener\">inhouse Circular Text assistant<\/a> is definitely worth a revisit.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-circular-wording-text-tutorial\/' rel=\"noopener\">Audio Card Circular Wording Text Tutorial<\/a>.<\/p-->\n<hr>\n<p id='acpt'>Previous relevant <a target=\"_blank\" title='Audio Card Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-primer-tutorial\/' rel=\"noopener\">Audio Card Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Audio Card Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.gif\" title=\"Audio Card Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Audio Card Primer Tutorial<\/p><\/div>\n<p>We&#8217;re starting a new project today.  It&#8217;s not a &#8220;postcard&#8221; today, it&#8217;s an &#8220;audio card&#8221;, building on those &#8220;in place&#8221; <a target=\"_blank\" title='YouTube' href='http:\/\/youtube.com' rel=\"noopener\">YouTube<\/a> (audio stream of) video referencing links of class &#8220;audioytplay&#8221; we talked about recently with <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/external-javascript-youtube-audio-of-video-numericals-tutorial\/' title='External Javascript YouTube Audio of Video Numericals Tutorial' rel=\"noopener\">External Javascript YouTube Audio of Video Numericals Tutorial<\/a>.<\/p>\n<p>The external Javascript of that project can help out here in amongst the hashtag organized sharing mechanisms there for &#8230;<\/p>\n<ul>\n<li>Email &#128231;<\/li>\n<li>SMS &#128223;<\/li>\n<li>Iframe (below) &#11015;<\/li>\n<\/ul>\n<p> &#8230; sharing means.  What the user is asked for to create this online &#8220;audio card&#8221; is &#8230;<\/p>\n<ul>\n<li>a mandatory YouTube video 11 character ID (whose audio stream, only, will be playable for the user or communication recipient) &#8230;\n<ol>\n<li>optional start (in seconds) of an audio (stream of video) snippet<\/li>\n<li>optional end (in seconds) of an audio (stream of video) snippet<\/li>\n<\/ol>\n<\/li>\n<li>optional &#8220;audio card&#8221; wording<\/li>\n<li>optional &#8220;audio card&#8221; background image<\/li>\n<\/ul>\n<p> &#8230; appearing in this <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html_GETME\" rel=\"noopener\">&#8220;proof of concept&#8221; first draft<\/a> <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/HTMLCSS\/audio_card.html\" rel=\"noopener\">Audio Card creator<\/a> helped out by <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html-------------------------------------------------GETME\" rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html-------------------------------------------------GETME\" rel=\"noopener\">karaoke_youtube_api.htm<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.htm\" rel=\"noopener\">inhouse YouTube video interfacer<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d67839' onclick='var dv=document.getElementById(\"d67839\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/audio\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d67839' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d67848' onclick='var dv=document.getElementById(\"d67848\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/iframe\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d67848' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d67858' onclick='var dv=document.getElementById(\"d67858\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d67858' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This current project may be about YouTube basis &#8220;audio cards&#8221;, but inevitably, if we offer background image possibilities, some users may turn it&#8217;s functionality, more, into a &#8220;postcard&#8221; feeling presentation. But, with yesterday&#8217;s Audio Card Circular Wording Text Tutorial only &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/audio-card-background-image-quality-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,20,30,37],"tags":[2419,113,5153,2682,127,183,184,3095,208,4319,4323,1654,2276,2147,1923,367,380,452,557,576,587,590,5155,626,631,673,5157,795,1705,894,1738,1918,5156,967,2519,997,1897,1133,1137,1159,3224,5154,1675,1319,1369,2308,1493,1496],"class_list":["post-67858","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-ios","category-photography","category-tutorials","tag-aesthetics","tag-audio","tag-audio-card","tag-background-colour","tag-background-image","tag-camera","tag-canvas","tag-card","tag-circle","tag-circular","tag-circular-text","tag-data-uri","tag-delimitation","tag-delimiter","tag-density","tag-dropdown","tag-email","tag-form","tag-hashtag","tag-html","tag-iframe","tag-image","tag-image-quality","tag-ios","tag-iphone","tag-keyboard","tag-mandatory","tag-mobile","tag-onkeydown","tag-overlay","tag-photo","tag-pixel","tag-pixel-density","tag-popup","tag-postcard","tag-programming","tag-quality","tag-share","tag-sharing","tag-sms","tag-stream","tag-take-photo","tag-textbox","tag-tutorial","tag-video","tag-wording","tag-youtube","tag-z-index"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67858"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=67858"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67858\/revisions"}],"predecessor-version":[{"id":67905,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/67858\/revisions\/67905"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=67858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=67858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=67858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}