42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package main
|
|
|
|
//func main() {
|
|
// // ==================== 在这里设置你的参数 ====================
|
|
// config := &Config{
|
|
// OutputDir: "D:\\isbn_images\\result", // 输出根目录
|
|
// FileName: "D:\\isbn_images\\result\\9771671688095.jpg",
|
|
// MatchDir: "matched", // 满足条件的图片目录
|
|
// UnmatchDir: "unmatched", // 不满足条件的图片目录
|
|
// EqualHeightDir: "equalHeight",
|
|
// WhiteDir: "white",
|
|
// WhiteBorderPngDir: "whiteBorderPng",
|
|
// MinWhitePct: 0.1, // 纯白占比下限 10%
|
|
// MaxWhitePct: 0.65, // 纯白占比上限 90%
|
|
// Extensions: []string{"jpg", "jpeg", "png", "gif", "bmp", "webp"},
|
|
// }
|
|
//
|
|
// //err := processImage(config)
|
|
// //if err != nil {
|
|
// // fmt.Println(err)
|
|
// //}
|
|
// //
|
|
// //file, err := resizeToHeightQuality(config, 700)
|
|
// //if err != nil {
|
|
// // fmt.Println(err)
|
|
// //}
|
|
// //fmt.Println(file)
|
|
// //config.FileName = file
|
|
// //fmt.Println(config)
|
|
// //file1, err := createWhiteBottomCenteredImage(config, 800, 800)
|
|
// //if err != nil {
|
|
// // fmt.Println(err)
|
|
// //}
|
|
// //fmt.Println(file1)
|
|
//
|
|
// png, err := removeWhiteBorderAndPNG(config)
|
|
// if err != nil {
|
|
// fmt.Println(err)
|
|
// }
|
|
// fmt.Println(png)
|
|
//}
|