remove dead code and comments
This commit is contained in:
parent
2b1253e416
commit
5c8f6bf443
1
Makefile
1
Makefile
@ -6,7 +6,6 @@ livereload:
|
||||
local:
|
||||
go run main.go --local-assets --images-dir w.tmp/images --collages-dir w.tmp
|
||||
|
||||
|
||||
update_croppie:
|
||||
curl -Lo web/croppie.min.js https://github.com/Foliotek/Croppie/raw/v2.6.5/croppie.min.js
|
||||
curl -Lo web/croppie.css https://github.com/Foliotek/Croppie/raw/v2.6.5/croppie.css
|
||||
|
@ -104,17 +104,6 @@ func TestCrop(t *testing.T) {
|
||||
if string(refImgPrefix) != croppedImgPrefix {
|
||||
t.Fatalf("Cropped image is not the same as reference image")
|
||||
}
|
||||
// SavePrefix(cropped)
|
||||
// expectedImage, err := GetImage(testDataFS, "test_output.jpg")
|
||||
// if err != nil {
|
||||
// t.Fatalf("failed to get reference crop image %v", err)
|
||||
// }
|
||||
// fmt.Printf("%v\n", cropped)
|
||||
// fmt.Printf("%v\n", expectedImage)
|
||||
// if fmt.Sprintf("%#v", cropped) != fmt.Sprintf("%#v", expectedImage) {
|
||||
// t.Fatalf("Cropped image is not the same as reference image")
|
||||
// }
|
||||
// SaveImage(cropped)
|
||||
}
|
||||
|
||||
// Save first 1000 bytes of string representation to compare against reference
|
||||
|
15
web/index.js
15
web/index.js
@ -114,14 +114,6 @@ function initCollage() {
|
||||
}
|
||||
}
|
||||
|
||||
function showCrop() {
|
||||
for(cpie of crops) {
|
||||
console.log(cpie.get())
|
||||
console.log(cpie.element.clientWidth)
|
||||
console.log(cpie.element.clientHeight)
|
||||
}
|
||||
}
|
||||
|
||||
async function makeCollage(req) {
|
||||
const resp = await fetch("make-collage", {
|
||||
method: "POST",
|
||||
@ -136,7 +128,6 @@ async function makeCollage(req) {
|
||||
function snap() {
|
||||
const col = collageDiv.offsetLeft;
|
||||
const cot = collageDiv.offsetTop;
|
||||
console.log("----------------------")
|
||||
const req = {
|
||||
background_image: "",
|
||||
aspect: {
|
||||
@ -152,11 +143,6 @@ function snap() {
|
||||
|
||||
for(const elem of collageDiv.getElementsByClassName("img")) {
|
||||
const cpie = crops[elem.dataset.collageCropieIndex]
|
||||
// console.log(cpie.get().points)
|
||||
// console.log(elem.offsetLeft - col)
|
||||
// console.log(elem.offsetTop - cot)
|
||||
// console.log(elem.clientWidth)
|
||||
// console.log(elem.clientHeight)
|
||||
const fsx = elem.offsetLeft - col
|
||||
const fsy = elem.offsetTop - cot
|
||||
const [sx, sy, ex, ey] = cpie.get().points;
|
||||
@ -186,7 +172,6 @@ function snap() {
|
||||
req.photos.push(photo)
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(req));
|
||||
(async () => {
|
||||
const collagFile = await makeCollage(req)
|
||||
collageUrlA.href = `collages/${collagFile}`;
|
||||
|
Loading…
Reference in New Issue
Block a user