From 299bba5e141350c036d348812f05716bb09250d2 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Tue, 17 Apr 2018 16:35:33 +0200 Subject: [PATCH] Cleanup --- pages/editor/filteranime/lowresimages.go | 70 ------------------------ 1 file changed, 70 deletions(-) diff --git a/pages/editor/filteranime/lowresimages.go b/pages/editor/filteranime/lowresimages.go index bc2d7b1f..85dd78b8 100644 --- a/pages/editor/filteranime/lowresimages.go +++ b/pages/editor/filteranime/lowresimages.go @@ -29,73 +29,3 @@ func filterAnimeImages(ctx *aero.Context, title string, minExpectedWidth int, mi func googleImageSearch(anime *arn.Anime) string { return "https://www.google.com/search?q=" + anime.Title.Canonical + " anime cover" + "&tbm=isch&tbs=imgo:1,isz:lt,islt:qsvga" } - -// // LowResolutionAnimeImages ... -// func LowResolutionAnimeImages(ctx *aero.Context) string { -// basePath := path.Join(arn.Root, "images/anime/original/") -// files, err := ioutil.ReadDir(basePath) - -// if err != nil { -// return ctx.Error(http.StatusInternalServerError, "Error reading anime images directory", err) -// } - -// lowResAnime := []*arn.Anime{} - -// for _, file := range files { -// if file.IsDir() || strings.HasPrefix(file.Name(), ".") { -// continue -// } - -// fullPath := path.Join(basePath, file.Name()) -// width, height, _ := getImageDimensions(fullPath) - -// if width < arn.AnimeImageLargeWidth*2 || height < arn.AnimeImageLargeHeight*2 { -// animeID := file.Name() -// animeID = strings.TrimSuffix(animeID, filepath.Ext(animeID)) - -// anime, err := arn.GetAnime(animeID) - -// if err == nil { -// lowResAnime = append(lowResAnime, anime) -// } -// } -// } - -// // Sort -// arn.SortAnimeByQuality(lowResAnime) - -// // Limit -// count := len(lowResAnime) - -// if count > maxImageEntries { -// lowResAnime = lowResAnime[:maxImageEntries] -// } - -// return ctx.HTML(components.AnimeEditorListFull( -// "Anime with low resolution images", -// lowResAnime, -// count, -// "/editor/anime/missing/hiresimage", -// func(anime *arn.Anime) string { -// return "https://www.google.com/search?q=" + anime.Title.Canonical + "&tbm=isch" -// }, -// )) -// } - -// // getImageDimensions retrieves the dimensions for the given file path. -// func getImageDimensions(imagePath string) (int, int, error) { -// file, err := os.Open(imagePath) -// defer file.Close() - -// if err != nil { -// return 0, 0, err -// } - -// image, _, err := image.DecodeConfig(file) - -// if err != nil { -// return 0, 0, err -// } - -// return image.Width, image.Height, nil -// }