iOS will not display my canvas

This code works perfectly on a desktop or laptop, and on non-iOS mobile devices. It takes a thumbnail sample of an edited image and displays it at full size in a new canvas. On iOS, I just see a blank screen where the canvas should be.

function click5()
{       
    document.getElementById("preview").style = "visibility:visible;"; 
    document.getElementById("cPreviewCaption").style = "font-size:90%; font-weight:550; text-align:center; color:#FFFFFF; padding-top:6px;";  

    // Apply change to preview image which will open beneath thumbnails 
    var cP = document.getElementById("cPreview"); 
    var contextP = cP.getContext("2d");

    var cO = document.getElementById("cOriginal"); 
    var contextO = cO.getContext("2d");

    var imgData = contextO.getImageData(0,0,cO.width,cO.height);
    var data = imgData.data;



    //read full size image 
    //similar image read/write code works fine in another image filter so this does not appear to be the issue 
    for (i = 0; i < data.length; i += 4)
    {                       
        red[i] = imgData.data[i];
        green[i] = imgData.data[i+1];
        blue[i] = imgData.data[i+2];
        alpha[i] = imgData.data[i+3];
    }

    //set adjustments represented by user interaction with thumbnails 
    for (i = 0; i < data.length; i += 4)
    {                       
        red[i] = red[i] + finalRedAdjust;
        if (red[i] < 0) red[i] = 0;  
        if (red[i] > 255) red[i] = 255; 
        green[i] = green[i] + finalGreenAdjust;
        if (green[i] < 0) green[i] = 0; 
        if (green[i] > 255) green[i] = 255; 
    }

    //write full size image with adjustments to memory  
    for (i = 0; i < data.length; i += 4)    
    {
        imgData.data[i] = red[i];
        imgData.data[i+1] = green[i];
        imgData.data[i+2] = blue[i]; 
        imgData.data[i+3] = alpha[i];   
    }               

    //write image in memory to file 
    contextP.putImageData(imgData, 0, 0);

    //add borders for canvases. 
    document.getElementById('cOriginal').style = "border-style:solid; border-color: #C0C0C0 #C0C0C0 #606060 #606060; visibility:hidden; display:none;"; 
    document.getElementById('cPreview').style = "border-style:solid; border-color: #C0C0C0 #C0C0C0 #606060 #606060; visibility:visible; display:block;"; 

    //Scroll page to preview image 
    location.hash = "null"; 
    location.hash = "previewAnchor";  
}
// End Table Click Event Functions

This code works perfectly on a desktop or laptop, and on non-iOS mobile devices. It takes a thumbnail sample of an edited image and displays it at full size in a new canvas. On iOS, I just see a blank screen where the canvas should be.

Thank you

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.