forked from FOSS/BangleApps
bla
parent
7cdc55a513
commit
c41947a497
|
@ -121,6 +121,8 @@ TODO:
|
||||||
console.log("Compression options", options);
|
console.log("Compression options", options);
|
||||||
var w = Math.round(width / TILESIZE);
|
var w = Math.round(width / TILESIZE);
|
||||||
var h = Math.round(height / TILESIZE);
|
var h = Math.round(height / TILESIZE);
|
||||||
|
console.log("Width", width);
|
||||||
|
console.log("Height", height);
|
||||||
var tiles = [];
|
var tiles = [];
|
||||||
for (var y=0;y<h;y++) {
|
for (var y=0;y<h;y++) {
|
||||||
for (var x=0;x<w;x++) {
|
for (var x=0;x<w;x++) {
|
||||||
|
@ -130,10 +132,7 @@ TODO:
|
||||||
options.width = TILESIZE;
|
options.width = TILESIZE;
|
||||||
options.height = TILESIZE;
|
options.height = TILESIZE;
|
||||||
var imgstr = imageconverter.RGBAtoString(rgba, options);
|
var imgstr = imageconverter.RGBAtoString(rgba, options);
|
||||||
ctx.putImageData(imageData,x*TILESIZE, y*TILESIZE); // write preview
|
ctx.putImageData(imageData,x*TILESIZE, y*TILESIZE);
|
||||||
/*var compress = 'require("heatshrink").decompress('
|
|
||||||
if (!imgstr.startsWith(compress)) throw "Data in wrong format";
|
|
||||||
imgstr = imgstr.slice(compress.length,-1);*/
|
|
||||||
tiles.push({
|
tiles.push({
|
||||||
name:"openseamap-"+x+"-"+y+".img",
|
name:"openseamap-"+x+"-"+y+".img",
|
||||||
content:imgstr,
|
content:imgstr,
|
||||||
|
|
Loading…
Reference in New Issue