fixed bug with saving applied enhancements
This commit is contained in:
parent
9c8bc6ee6c
commit
fb35110066
1 changed files with 8 additions and 3 deletions
|
@ -267,7 +267,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
if (options.displayMode === "double" && typeof page2 === "object") { context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height); }
|
if (options.displayMode === "double" && typeof page2 === "object") { context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height); }
|
||||||
|
|
||||||
// apply any image enhancements previously defined
|
// apply any image enhancements previously defined
|
||||||
$.each(options.enhance, function(action, options){
|
$.each(options.enhance, function(action, options) {
|
||||||
ComicBook.prototype.enhance[action](options);
|
ComicBook.prototype.enhance[action](options);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -340,7 +340,7 @@ function ComicBook(id, srcs, opts) {
|
||||||
var opts = merge({ brightness: 0, contrast: 0 }, params);
|
var opts = merge({ brightness: 0, contrast: 0 }, params);
|
||||||
|
|
||||||
// remember options for later
|
// remember options for later
|
||||||
options.enhance.brightness = options;
|
options.enhance.brightness = opts;
|
||||||
|
|
||||||
// run the enhancement
|
// run the enhancement
|
||||||
Pixastic.process(canvas, "brightness", {
|
Pixastic.process(canvas, "brightness", {
|
||||||
|
@ -356,8 +356,11 @@ function ComicBook(id, srcs, opts) {
|
||||||
* Force black and white
|
* Force black and white
|
||||||
*/
|
*/
|
||||||
desaturate: function () {
|
desaturate: function () {
|
||||||
|
|
||||||
options.enhance.desaturate = {};
|
options.enhance.desaturate = {};
|
||||||
|
|
||||||
Pixastic.process(canvas, "desaturate", { average : false });
|
Pixastic.process(canvas, "desaturate", { average : false });
|
||||||
|
|
||||||
init();
|
init();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -373,6 +376,8 @@ function ComicBook(id, srcs, opts) {
|
||||||
|
|
||||||
var opts = merge({ amount: 0 }, params);
|
var opts = merge({ amount: 0 }, params);
|
||||||
|
|
||||||
|
options.enhance.sharpen = opts;
|
||||||
|
|
||||||
Pixastic.process(canvas, "sharpen", {
|
Pixastic.process(canvas, "sharpen", {
|
||||||
amount: opts.amount
|
amount: opts.amount
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue