package main

import (
	"fmt"
	"log"

	"github.com/disintegration/imaging"
)

func main() {
	path := "./uploads/items/background.png"

	img, err := imaging.Open(path)
	if err != nil {
		log.Fatal(err)
	}

	resized := imaging.Resize(img, 1920, 0, imaging.Lanczos)

	newPath := "./uploads/items/background.jpg"

	err = imaging.Save(resized, newPath, imaging.JPEGQuality(82))
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("Готово")
}
