mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-06-28 14:16:24 +02:00
mtwebmapper: First version of pyramid tile updater. Needs testing.
This commit is contained in:
@ -5,11 +5,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"image"
|
||||
"image/draw"
|
||||
"image/png"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"math"
|
||||
@ -158,7 +156,7 @@ var dps = [4]image.Point{
|
||||
image.Pt(256, 256),
|
||||
image.Pt(256, 0)}
|
||||
|
||||
func fuseTile(scratch *image.RGBA, job *pyramidJob) (err error) {
|
||||
func fuseTile(scratch *image.RGBA, job *pyramidJob) error {
|
||||
|
||||
for i, path := range job.src {
|
||||
|
||||
@ -172,21 +170,7 @@ func fuseTile(scratch *image.RGBA, job *pyramidJob) (err error) {
|
||||
|
||||
resized := resize.Resize(256, 256, scratch, resize.Lanczos3)
|
||||
|
||||
var outFile *os.File
|
||||
if outFile, err = os.Create(job.dst); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
out := bufio.NewWriter(outFile)
|
||||
|
||||
if err = png.Encode(out, resized); err != nil {
|
||||
outFile.Close()
|
||||
return
|
||||
}
|
||||
|
||||
out.Flush()
|
||||
err = outFile.Close()
|
||||
return
|
||||
return common.SaveAsPNG(job.dst, resized)
|
||||
}
|
||||
|
||||
func fuseTiles(jobs chan pyramidJob, done *sync.WaitGroup) {
|
||||
|
Reference in New Issue
Block a user