Size testing

This commit is contained in:
Fred Boniface 2023-08-11 14:53:28 +01:00
parent 3fabb7db39
commit 3d5f755226
3 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@ package imaging
import "image" import "image"
func Generate(height, width int, style, format string, data []LocationData) image.Image { func Generate(height, width int, style, format string, data []string) image.Image {
img := createCanvas(width, height) img := createCanvas(width, height)
return img return img
} }

View File

@ -2,10 +2,15 @@ package run
import ( import (
"fmt" "fmt"
"image"
"os" "os"
"git.fjla.uk/fred.boniface/map-dots/imaging"
"git.fjla.uk/fred.boniface/map-dots/log"
) )
func CLI(height, width uint64, style, format, input string) { func CLI(height, width uint64, style, format, input string) {
log.Msg.Info("CLI Mode Started")
fmt.Printf("Running CLI mode with height=%d, width=%d, type=%s, input=%s\n", height, width, style, input) fmt.Printf("Running CLI mode with height=%d, width=%d, type=%s, input=%s\n", height, width, style, input)
fmt.Println("CLI Mode not implemented") fmt.Println("CLI Mode not implemented")
@ -18,6 +23,8 @@ func CLI(height, width uint64, style, format, input string) {
// Check that `input` is a valid filepath and points to a valid file. // Check that `input` is a valid filepath and points to a valid file.
// Use relevent package to parse file // Use relevent package to parse file
// Pass parsed data to imaging package // Pass parsed data to imaging package
var testing []string
var _ image.Image = imaging.Generate(1, 1, "circle", "png", testing)
fmt.Println("End of implementation") fmt.Println("End of implementation")
} }

View File

@ -11,10 +11,13 @@ func envCheck() {
log.Msg.Debug("reading Traccar credentials from environment") log.Msg.Debug("reading Traccar credentials from environment")
user := os.Getenv("TRACCAR_USER") user := os.Getenv("TRACCAR_USER")
pass := os.Getenv("TRACCAR_PASS") pass := os.Getenv("TRACCAR_PASS")
url := os.Getenv("TRACCAR_URL")
if user == "" || pass == "" { if user == "" || pass == "" || url == "" {
fmt.Println("To use Traccar, you must set the environment variables:\n'TRACCAR_USER', 'TRACCAR_PASS', and for CLI use only 'TRACCAR_DEVID'") fmt.Println("To use Traccar, you must set the environment variables:\n'TRACCAR_USER', 'TRACCAR_PASS', and for CLI use only 'TRACCAR_DEVID'")
os.Stdout.Sync() // Flush the output buffer os.Stdout.Sync() // Flush the output buffer
log.Msg.Fatal("Unable to read values from environment") log.Msg.Fatal("Unable to read values from environment")
} }
log.Msg.Debug("Traccar credentials exist in environment")
} }