I have checked chmod and file is -rw-rw-rw so am not sure why its not writing image as it was before. Is my reference wrong do I need something like /htddocs/images/ nowplaying_artwork_2.png?
Could you please double check the file that’s actually being stored?
Our hosting sends quite aggressive caching headers by default, so it’s possible that your image may have been updated in the background, but your browser just isn’t loading it.
If this is the case, you can bypass the cache by adding a query parameter to the URL (like nowplaying_artwork_2.png?version=latest), which bypasses the cache.
@anon14276620 what do you really want to achieve?
Do you want it to automatically change the “album cover” from the play list as soon as a new song/set starts playing?
Ok here goes Oxy . I hope this helps and than you for your help its much appreciated I will try my best:
1 ) page does not refresh with latest image in http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png. I even deleted this image and refreshed page (see my posts for images the same error) was displayed nothing saying image not found. instead if you refresh this it appears with some major delay.
the image write in file ‘add_track.php’ creates records and image . It does not seem to do this either properly as records are missing from SQL and file does not get changed all the time. I have placed a ftp upload from my end every time track changes of it so that other testing can take place… If I open refresh of http://www.deniserose.epizy.com/music_now_playing.php the icon does not change if I open the image http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png if I refresh this it does show correct image again some strange delay.
.My pages to refresh this http://www.deniserose.epizy.com/music_now_playing.php is in Javascript file ‘fetch_updater .js’ uses Ajax Timer an calls its page routinely to check image change but neither process in it seem to deliver base64from image on screen and in file which has worked without syntax error elsewhere. the chrome f12 debugger finds no errors when you run a trace and record network it shows fetchupdater.js firing and does not provide 64code in .base64file1 or base64file2
code snipit from fetchupdater.js:
my php all use things like strlen( and fwrite( from PHP which don’t seem to function either. https://i.gyazo.com/549031e220324ba71f6e165e6822afdd.png as you can see blank records are created and some records shown on the page do not remain in sql
I am aware not all files have been converted to use your different sql that you use .
On a note on the errors you recorded these seem to be all stylistic errors which do not affect function. Also please note i don’t have my last working code previous website wont provide it to me . So this is causing repeat debugging .
I had pondered if this indicated corruption on the site on the server ?
my urls are added with “<img id=#np_track_artwork src=/images/nowplaying_artwork_2.png?t=”+$time+" alt=‘Playing track artwork’ width=200 height=200>" but i tried
“<img id=#np_track_artwork src=/images/nowplaying_artwork_2.png?version=”+$time+" alt=‘Playing track artwork’ width=200 height=200>"
It was still no better . I asked for sfc as my fetch routine was working and was then today producing corrupted table . I had to go back to a copy here and start again hopeful it held
Storing blob is a very poor practice. However what you do is, upload the image on the server and store its path in the database.
Like home/vol/assets/user/sc-12/koala.png.
I don’t really understand them in SQL I am hopeful for help in SQL they come up as [BLOB-1B] in PHPBrowser as empty if i have a field ImagBase64 defined as BLOB .Can I load this with base64 as in base64_decode($artwork2); or do I have to add it to a blob with url then upload that in sql or is there a better way of compacting it. I thought it could be resized in a image by creating new image resized I haven’t worked that out yet?
Here is what I have to convert it :
var image = document.createElement("img");
image.src = 'http://www.deniserose.epizy.com/images/nowplaying_artwork_2.png?tr=w-200,h-200'
$b64Data= base64_decode($artwork);
const byteCharacters = atob(b64Data);
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray], {type: contentType});
My generated
var startDate = new Date(‘1/1/2019’); // this
var startMsec = startDate.getTime();// we get the time from the date in milliseconds
var toDate = new Date(); // the current date.
var ourTime = toDate.getTime();// we grap
var elapsed = (ourTime - startMsec) / 1000;