You've already forked collage-maker
							
							Cleanup for 1.0 #18
							
								
								
									
										56
									
								
								cmd/run.go
									
									
									
									
									
								
							
							
						
						
									
										56
									
								
								cmd/run.go
									
									
									
									
									
								
							@@ -1,56 +0,0 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
 | 
			
		||||
	"go.balki.me/collage-maker/collage"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	req := collage.Request{}
 | 
			
		||||
	/*
 | 
			
		||||
			reqStr := []byte(`
 | 
			
		||||
		{
 | 
			
		||||
		  "background_image": "",
 | 
			
		||||
		  "aspect": { "width": 4224, "height": 3264 },
 | 
			
		||||
		  "dimension": { "width": 1187, "height": 848 },
 | 
			
		||||
		  "photos": [
 | 
			
		||||
			{
 | 
			
		||||
			  "image": "img1.jpg",
 | 
			
		||||
			  "crop": {
 | 
			
		||||
				"start": { "x": 419, "y": 667 },
 | 
			
		||||
				"end": { "x": 2707, "y": 3389 }
 | 
			
		||||
			  },
 | 
			
		||||
			  "frame": {
 | 
			
		||||
				"start": { "x": 0, "y": 0 },
 | 
			
		||||
				"end": { "x": 712, "y": 848 }
 | 
			
		||||
			  }
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
			  "image": "img2.jpg",
 | 
			
		||||
			  "crop": {
 | 
			
		||||
				"start": { "x": 331, "y": 44 },
 | 
			
		||||
				"end": { "x": 1132, "y": 1468 }
 | 
			
		||||
			  },
 | 
			
		||||
			  "frame": {
 | 
			
		||||
				"start": { "x": 712, "y": 0 },
 | 
			
		||||
				"end": { "x": 1187, "y": 848 }
 | 
			
		||||
			  }
 | 
			
		||||
			}
 | 
			
		||||
		  ]
 | 
			
		||||
		}
 | 
			
		||||
		`)
 | 
			
		||||
	*/
 | 
			
		||||
	// {"background_image":"","aspect":{"width":4224,"height":3264},"dimension":{"width":1187,"height":848},"photos":[{"image":"img1.jpg","crop":{"start":{"x":528,"y":3},"end":{"x":2696,"y":2583}},"frame":{"start":{"x":0,"y":0},"end":{"x":712,"y":848}}},{"image":"img2.jpg","crop":{"start":{"x":410,"y":0},"end":{"x":1014,"y":1074}},"frame":{"start":{"x":712,"y":0},"end":{"x":1187,"y":848}}}]}
 | 
			
		||||
	reqStr := []byte(`
 | 
			
		||||
{"background_image":"","aspect":{"width":4224,"height":3264},"dimension":{"width":1097,"height":848},"photos":[{"image":"img1.jpg","crop":{"start":{"x":448,"y":595},"end":{"x":2721,"y":3560}},"frame":{"start":{"x":0,"y":0},"end":{"x":649,"y":848}}},{"image":"img2.jpg","crop":{"start":{"x":418,"y":1},"end":{"x":1022,"y":1180}},"frame":{"start":{"x":665,"y":0},"end":{"x":1098,"y":848}}}]}
 | 
			
		||||
`)
 | 
			
		||||
	err := json.Unmarshal(reqStr, &req)
 | 
			
		||||
	fmt.Println(err)
 | 
			
		||||
	out, err := os.Create("./collage.jpg")
 | 
			
		||||
	fmt.Println(err)
 | 
			
		||||
	err = collage.Make(&req, os.DirFS("."), out)
 | 
			
		||||
	fmt.Println(err)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										24
									
								
								standard.go
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								standard.go
									
									
									
									
									
								
							@@ -1,24 +0,0 @@
 | 
			
		||||
package main
 | 
			
		||||
 | 
			
		||||
type Resolution struct {
 | 
			
		||||
	X uint
 | 
			
		||||
	Y uint
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// increased by factor 1.5
 | 
			
		||||
// https://www.adorama.com/alc/pixels-and-printing-size-matters/
 | 
			
		||||
 | 
			
		||||
var Letter = Resolution{
 | 
			
		||||
	X: 3264,
 | 
			
		||||
	Y: 4224,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var FiveXSeven = Resolution{
 | 
			
		||||
	X: 2250,
 | 
			
		||||
	Y: 3150,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var FourXSix = Resolution{
 | 
			
		||||
	X: 1800,
 | 
			
		||||
	Y: 2700,
 | 
			
		||||
}
 | 
			
		||||
@@ -1,36 +0,0 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
    <head>
 | 
			
		||||
        <link rel="icon" href="data:;base64,iVBORw0KGgo=" />
 | 
			
		||||
        <style>
 | 
			
		||||
.paper {
 | 
			
		||||
    width: 8.5in;
 | 
			
		||||
    height: 11in;
 | 
			
		||||
    overflow: hidden;
 | 
			
		||||
    margin: auto;
 | 
			
		||||
    display: flex;
 | 
			
		||||
    flex-direction: column;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    justify-content: space-around;
 | 
			
		||||
    background-color: gainsboro;
 | 
			
		||||
}
 | 
			
		||||
.img1, .img2 {
 | 
			
		||||
    width: 7in;
 | 
			
		||||
    height: 5in;
 | 
			
		||||
}
 | 
			
		||||
.img1 {
 | 
			
		||||
    background-color: blue;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.img2 {
 | 
			
		||||
    background-color: yellow;
 | 
			
		||||
}
 | 
			
		||||
        </style>
 | 
			
		||||
    </head>
 | 
			
		||||
    <body>
 | 
			
		||||
        <div class="paper">
 | 
			
		||||
            <div class="img1"></div>
 | 
			
		||||
            <div class="img2"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </body>
 | 
			
		||||
</html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user