{"action":"created","issue":{"url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/271","labels_url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/271/labels{/name}","comments_url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/271/comments","events_url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/271/events","html_url":"https://github.com/literallycanvas/literallycanvas/issues/271","id":60665266,"number":271,"title":"Cannot save when add big image as background","user":{"login":"nobutsta","id":1971066,"avatar_url":"https://avatars.githubusercontent.com/u/1971066?v=3","gravatar_id":"","url":"https://api.github.com/users/nobutsta","html_url":"https://github.com/nobutsta","followers_url":"https://api.github.com/users/nobutsta/followers","following_url":"https://api.github.com/users/nobutsta/following{/other_user}","gists_url":"https://api.github.com/users/nobutsta/gists{/gist_id}","starred_url":"https://api.github.com/users/nobutsta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobutsta/subscriptions","organizations_url":"https://api.github.com/users/nobutsta/orgs","repos_url":"https://api.github.com/users/nobutsta/repos","events_url":"https://api.github.com/users/nobutsta/events{/privacy}","received_events_url":"https://api.github.com/users/nobutsta/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-11T14:19:57Z","updated_at":"2015-08-05T10:36:56Z","closed_at":"2015-07-31T18:11:30Z","body":"Hello,\r\nI tried set up big image from my camera as a background so we can draw a cartoon on it. But finally I can save it into file for some reason. It seems like those encoded image cannot send through. This is my code before sending.\r\n\r\n      $(document).ready(function() {\r\n        // disable scrolling on touch devices so we can actually draw\r\n        $(document).bind('touchmove', function(e) {\r\n          if (e.target === document.documentElement) {\r\n            return e.preventDefault();\r\n          }\r\n        });\r\n\r\n        LC.setDefaultImageURLPrefix('icons/');\t\t\r\n\r\n        var backgroundImage = new Image();\r\n        backgroundImage.src = '<?=urldecode($_GET[file]);?>';\r\n\r\n\t\tvar logo = new Image();\r\n        logo.src = 'images/logo153x60.png'\r\n\r\n        // the only LC-specific thing we have to do\r\n        var containerOne = document.getElementsByClassName('workSpace')[0];\r\n        var lc = LC.init(containerOne, {\r\n\t\t\timageSize: {width: 1200, height: 800},\r\n          backgroundShapes: [\r\n            LC.createShape('Image', {image: backgroundImage, x: 0, y: 0, image: backgroundImage, scale: 1}),//position of background\r\n\t\t\tLC.createShape('Image', {image: backgroundImage, x: 10, y: 690, image: logo, scale: 1})//logo\r\n          ]\r\n        });\r\n        window.demoLC = lc;\r\n        lc.loadSnapshotJSON(localStorage.getItem('drawing'));//load previous drawing\r\n\r\n        lc.on('drawingChange', function() {\r\n          localStorage.setItem('drawing', lc.getSnapshotJSON());\r\n        });\r\n\r\n         //lc.setPan(100, 100);\r\n\t\t lc.setImageSize(1200, 800);//set the reset image size\r\n\t\t//var exportIMG=lc.getImage({rect: {x: 0, y: 0, width: 800, height: 600},scale: 1}).toDataURL();\r\n        \r\n\t\t$('[data-action=exportIMG]').click(function(e) {\r\n\t\t  e.preventDefault();\r\n\r\n\t\t  $('.export_btn').html('Saving...')\r\n\t\t  // this is all standard Imgur API; only LC-specific thing is the image\r\n\t\t  // data argument;\r\n\t\t  $.ajax({\r\n\t\t\turl: 'print.php',\r\n\t\t\ttype: 'POST',\r\n\t\t\tdata: {\r\n\t\t\t  // convert the image data to base64\r\n\t\t\t\tfilename:'<?=$_GET[file]?>',\r\n\t\t\t\timage:  lc.canvasForExport().toDataURL().split(',')[1]\r\n\t\t\t},\r\n\t\t\tsuccess: function(data) {\r\n\t\t\t\tif(jQuery.trim(data) === \"ok\"){\r\n\t\t\t\t\t$('#saveModal').modal('show'); \r\n\t\t\t\t\t$(\".modal-title\").html(\"Luckily\");\r\n\t\t\t\t\t$(\".modal-body\").html(\"<span class=\\\"text-success\\\">Photo saved</span>\");\r\n\t\t\t\t\t//$(\".modal-body\").html(data);\r\n\t\t\t\t  }else{\r\n\t\t\t\t\t$('#saveModal').modal('show'); \r\n\t\t\t\t\t$(\".modal-title\").html(\"Error\");\r\n\t\t\t\t\t//$(\".modal-body\").html(\"<span class=\\\"text-danger\\\">Cannot save</span>\");\r\n\t\t\t\t\t$(\".modal-body\").html(data);\r\n\t\t\t\t\t\r\n\t\t\t\t  }//if\r\n\t\t\t\t  //setTimeout(function() { $('#saveModal').modal('hide'); }, 2000);//hide modal after 2 sec\r\n\t\t\t},//success\r\n\t\t  });\r\n\t\t  return false;\r\n\t\t});//click(function(e)\r\n      });\r\n\r\nI am searching for couple of days for this but no luck. Please point me out."},"comment":{"url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/comments/127951741","html_url":"https://github.com/literallycanvas/literallycanvas/issues/271#issuecomment-127951741","issue_url":"https://api.github.com/repos/literallycanvas/literallycanvas/issues/271","id":127951741,"user":{"login":"nobutsta","id":1971066,"avatar_url":"https://avatars.githubusercontent.com/u/1971066?v=3","gravatar_id":"","url":"https://api.github.com/users/nobutsta","html_url":"https://github.com/nobutsta","followers_url":"https://api.github.com/users/nobutsta/followers","following_url":"https://api.github.com/users/nobutsta/following{/other_user}","gists_url":"https://api.github.com/users/nobutsta/gists{/gist_id}","starred_url":"https://api.github.com/users/nobutsta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nobutsta/subscriptions","organizations_url":"https://api.github.com/users/nobutsta/orgs","repos_url":"https://api.github.com/users/nobutsta/repos","events_url":"https://api.github.com/users/nobutsta/events{/privacy}","received_events_url":"https://api.github.com/users/nobutsta/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T10:36:56Z","updated_at":"2015-08-05T10:36:56Z","body":"Hello, since that day. My problem hasn't solved yet. The problem is still with the `setZoom()`. The photo I use for the background(3696x2448) was taken from a camera. Which is bigger than the viewing area of the program (1016x665px). So I set the zoom to `setZoom(0.28)`. This perfectly fit the view area. But the other problem is. When an export button is clicked. The picture with drawing is not come out as it suppose to be. \r\n\r\nI also tried resized the original photo to 1016x665. And use it as a background image. With no `setZoom()` function. This not export the picture too! I think the problem is around the setting the view zoom.\r\n\r\nPlease suggest,"}}