• Resolved Mohsin Alam

    (@mohsinworld)


    I found a problem on my website. Image first load then disappear in my MacBook Pro 13″ Laptop. Because link adds automatically @2x before image extension [example: when first load then image URL is this mysite.com/logo.png then when broke the logo image then the image URL show mysite.com/[email protected]]. I installed this plugin but haven’t fixed the problem. How can I solve this? Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    You probably using a theme that is still using the old Retina.js script. My plugin can help you but you would need to disable that old script. Maybe in the options of your themes…

    Thread Starter Mohsin Alam

    (@mohsinworld)

    There is no such option in the themes setting [options]. How can I fix it by your plugin?

    Thread Starter Mohsin Alam

    (@mohsinworld)

    I found a file in themes https://caboproperties.com/wp-content/themes/realestate-6/js/retina.js but I don’t know what to do. can you please guide me? I’ll be grateful to you.

    Thread Starter Mohsin Alam

    (@mohsinworld)

    This file contain this code:

    // retina.js, a high-resolution image swapper (https://retinajs.com), v0.0.2
    
    (function(){function t(e){this.path=e;var t=this.path.split(“.”),n=t.slice(0,t.length-1).join(“.”),r=t[t.length-1];this.at_2x_path=n+”@2x.”+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute(“src”));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports==”undefined”?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match(“//”+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open(“HEAD”,this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute(“width”,t.el.offsetWidth),t.el.setAttribute(“height”,t.el.offsetHeight),t.el.setAttribute(“src”,e)):setTimeout(n,5)}typeof e==”undefined”&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName(“img”),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    • This reply was modified 7 years, 9 months ago by bdbrown.
    • This reply was modified 7 years, 9 months ago by bdbrown.
    Thread Starter Mohsin Alam

    (@mohsinworld)

    Update: I removed retina.js file and the problem is gone now. ??

    • This reply was modified 7 years, 9 months ago by Mohsin Alam.
    Plugin Author Jordy Meow

    (@tigroumeow)

    Yes, that’s the solution ?? But you should remove its loading in a clean way, through the functions.php of your theme probably. I am surprised they don’t have an option, maybe you should mention that to them and to use my plugin instead for example.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image broke after first load’ is closed to new replies.