Support PNG, JPEG, BMP, WEBP export formats by change of "Export to PNG" menu item into "Export" with its own pull-down dialog (and a HTML5 range type input element for "quality" selection for JPEG or WEBP files), including changes for the server_opensave extension; change locale key from "export_png" to "export_img" and change the corresponding localized strings (currently CS, DE, ES, FR, IT, NL, PT-BR, RO, SK, all reset to English to avoid translation errors); within the setCustomHandlers() API, deprecate "pngsave" in favor of "exportImage" (chosen to avoid just using the simpler but reserved JS keyword "export") including use within the server_opensave extension; a few JSLint-friendly changes

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2602 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Brett Zamir
2013-10-28 03:53:30 +00:00
parent 0c88f41818
commit f8aeacd7a8
64 changed files with 159 additions and 108 deletions

View File

@@ -4294,10 +4294,12 @@ this.save = function(opts) {
};
// Function: rasterExport
// Generates a PNG Data URL based on the current image, then calls "exported"
// with an object including the string and any issues found
this.rasterExport = function() {
// remove the selected outline before serializing
// Generates a Data URL based on the current image, then calls "exported"
// with an object including the string, image information, and any issues found
this.rasterExport = function(imgType, quality) {
var mimeType = 'image/' + imgType.toLowerCase();
// remove the selected outline before serializing
clearSelection();
// Check for known CanVG issues
@@ -4323,7 +4325,7 @@ this.rasterExport = function() {
});
var str = this.svgCanvasToString();
call("exported", {svg: str, issues: issues});
call("exported", {svg: str, issues: issues, type: imgType, mimeType: mimeType, quality: quality});
};
// Function: getSvgString