imageupsizer

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: MIT Imports: 24 Imported by: 0

README

Google Image Upsizer

Build Release codecov Go Report Card Go Reference

Extract the best images from Google Image Search. Divergent fork of yms2772/google_image_upsizer.

How to use

go install github.com/kmulvey/imageupsizer
imageupsizer -path="original/test.jpg" -output="result/"

Required options

Name Type Description
-input string Path to the image file or directory you want to upscale
-output string Directory path to save results

Result

test test2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLargerAvailable = errors.New("there is no large image")
	ErrCaptcha           = errors.New("response was captcha page")
	ErrNoResults         = errors.New("no images found")
)
View Source
var NoMatchesError = errors.New("Looks like there aren’t any matches for your search")
View Source
var OtherSizesNotAvailableError = errors.New("No other sizes of this image found.")

Functions

func Convert added in v0.5.0

func Convert(from string) (string, string, error)

Convert converts pngs and webps to jpeg this first string returned is the name of the new file the second string returned is the type of the input image (png, webp), as detected from its encoding, not file name

Types

type ImageData

type ImageData struct {
	URL       string
	Bytes     []byte
	Extension string
	image.Config
	Area      int
	FileSize  int64
	LocalPath string
}

ImageData represents all the information about an image in the app

func FindLargerImageFromBytes

func FindLargerImageFromBytes(image []byte, outputFile string) (*ImageData, error)

FindLargerImageFromBytes takes a bytes and returns information about a larger image that was found. It does NOT download the image.

func FindLargerImageFromFile

func FindLargerImageFromFile(filename string) (*ImageData, error)

FindLargerImageFromFile takes a file and returns information about a larger image that was found. It does NOT download the image.

func GetImageConfigFromFile

func GetImageConfigFromFile(filename string) (*ImageData, error)

GetImageConfigFromFile returns ImageData for the given image

func GetLargerImageFromBytes

func GetLargerImageFromBytes(image []byte, outputDir string) (*ImageData, error)

GetLargerImageFromBytes is just like FindLargerImageFromBytes except it also downloads the file.

func GetLargerImageFromFile

func GetLargerImageFromFile(filename, outputDir string) (*ImageData, error)

GetLargerImageFromFile is just like FindLargerImageFromFile except it also downloads the file.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL