- حُلّت
Using canvas/context to scale an image that displays ok before removes the image data, ok in Chome/Safari.
The app sizes two adjacent images to the same height. Maybe there's a better approach? This works, in that I see the original image displayed at the wrong size: //im… (read more)
The app sizes two adjacent images to the same height. Maybe there's a better approach?
This works, in that I see the original image displayed at the wrong size:
//img.src = imgsrc.src;
This sizes the image but without the data (black square for toDataURL w/ image/jpeg) in FF, but not Chrome and Safari:
var canvas = document.createElement( 'canvas' ); canvas.width = width; canvas.height = avail_height; var context = canvas.getContext( '2d' );
// Tried/failed: Fill white background for JPEG export //context.fillStyle = '#fff'; //context.fillRect(0, 0, canvas.width, canvas.height);
context.drawImage( imgsrc, 0, 0, canvas.width, canvas.height); context.lineWidth = 150; // ??
img.src = canvas.toDataURL('image/jpeg', 0.92);
img.onmousedown = disableDragging; // for FF
img.style.opacity = "1.0"
The page is the view.html one gets to via Enter on phobrain.com.