Skip to content

Commit

Permalink
fix mimetype parse
Browse files Browse the repository at this point in the history
  • Loading branch information
shuming committed Jul 23, 2013
1 parent 457f375 commit 69f79c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions paste.js
Expand Up @@ -122,8 +122,9 @@ var ImageQueue = (function () {

ImageQueue.prototype.upload = function(idx, dataURL) {
var base64;
if (dataURL.indexOf('data:image/png;base64,') !== -1) {
base64 = dataURL.slice(22);
match_result = dataURL.match(/data:image\/(\w+);base64,(.*)/);
if(match_result) {
base64 = match_result[2];
}
var fd = new FormData();
fd.append('image', base64);
Expand Down
8 changes: 8 additions & 0 deletions stylesheet.css
Expand Up @@ -131,3 +131,11 @@ img {
.dropable-active {
border-color: #0c0;
}

.gritter-with-image {
width: 180px;
}

.gritter-image {
width: 86px;
}

0 comments on commit 69f79c7

Please sign in to comment.