imagechunk image fix:
the first 100+ pages of this thread contain lots of imagechunk images that are broken. i found on another forum that they had moved to lic.me and realised i could fix the img sources to point to the image at lic.me
for example:
the src is '
http://www.imagechunk.com/images/dionne_elite_alleyway_090417_cap1-d083fab1a0.jpg'
can be fixed to
the src is '
http://lic.me/uploaded_images/d/i/dionne_elite_alleyway_090417_cap1-d083fab1a0.jpg'
altering them manually is pointless so i created a
bookmarklet that can fix all the images on a page. a bookmarklet is a bookmark in your browser that instead of going to a page will run a javascript function on the page you have open to temporarily modify it.
the below codebox has the bookmarklet as a very long single line of text. to use it:
1) select all the text in the codebox and then copy it (the text below
Code:)
2) create a new bookmark in your browser
3) give the bookmark a meaningful name.. like
JS-imgchunkpicFix or something
4) paste the bookmarklet text into the url field of your new bookmark
5) when you're on a page with old imagechunk images click on the bookmark and it should fix most of them
Code:
javascript:{ var mypics=document.images; var mypictext=""; var mypictextdat=""; var mytextsplit = []; for (i=0; i<mypics.length; i++) { mytextsplit.length=0; mypictext=mypics[i].src; mypictextdat=mypics[i].getAttribute("data-original"); if (mypictext.indexOf("transp.gif") >= 0 && mypictextdat.indexOf("imagechunk") >= 0) mypictext=mypictextdat; if (mypictext.indexOf("imagechunk") >= 0 || mypictext.indexOf("lic.me/t/imgchunk_") >=0) { mytextsplit = mypictext.split("/"); mypictext=mytextsplit[mytextsplit.length-1]; if (mypictext.indexOf("index.php") >= 0) { mytextsplit.length=0; mytextsplit = mypictext.split("="); mypictext=mytextsplit[mytextsplit.length-1]; } else if (mypictext.indexOf("imgchunk_") >= 0) { mypictext = mypictext.replace("imgchunk_", ""); } mypictext = mypictext.replace("_thumb.", "."); mypics[i].src=("http://lic.me/uploaded_images/"+ mypictext.charAt(0) +"/"+ mypictext.charAt(1) +"/"+ mypictext); } }};void(0);
--
below is a multi-line version of the bookmarklet if you want to check it for safety reasons:
Code:
javascript:{
var mypics=document.images;
var mypictext="";
var mypictextdat="";
var mytextsplit = [];
for (i=0; i<mypics.length; i++) {
mytextsplit.length=0;
mypictext=mypics[i].src;
mypictextdat=mypics[i].getAttribute("data-original");
if (mypictext.indexOf("transp.gif") >= 0 && mypictextdat.indexOf("imagechunk") >= 0) mypictext=mypictextdat;
if (mypictext.indexOf("imagechunk") >= 0 || mypictext.indexOf("lic.me/t/imgchunk_") >=0) {
mytextsplit = mypictext.split("/");
mypictext=mytextsplit[mytextsplit.length-1];
if (mypictext.indexOf("index.php") >= 0) {
mytextsplit.length=0;
mytextsplit = mypictext.split("=");
mypictext=mytextsplit[mytextsplit.length-1];
}
else if (mypictext.indexOf("imgchunk_") >= 0) {
mypictext = mypictext.replace("imgchunk_", "");
}
mypictext = mypictext.replace("_thumb.", ".");
mypics[i].src=("http://lic.me/uploaded_images/"+ mypictext.charAt(0) +"/"+ mypictext.charAt(1) +"/"+ mypictext);
}
}
};void(0);
notes:
while most of the imagechunk images can be fixed, a few of them are broken or seem to be wrong images. this may be a problem with imagechunk being merged into lic.me, around 90% of them seem to work but this will only drop over time as some disappear.
it replaces imgchunk thumbnails with the fullsize image.
changes to a page aren't permanent. it just adjusts what you have open now.
version 1) designed for this forum (bshows)
version 2) added fix for older lic.me posts that i've seen on another forum (rpant)
version 3) added fix for lazyload images on another forum (lshow)
(tested on chromium browser. should work on others)
don't trust every bookmarklet you find on the internet.
always check through the code yourself before you trust it.