Categorygithub.com/previnder/citra
modulepackage
1.1.1
Repository: https://github.com/previnder/citra.git
Documentation: pkg.go.dev

# README

Citra

Citra is a simple web server that serves images.

# Packages

No description provided by the author
No description provided by the author

# Functions

AverageColor returns the average RGB color of img by averaging the colors of at most 10000 pixels.
ContainInResolution returns width and height as they fit into an image of size w and h.
DeleteImage sets is_deleted field of images to true.
GetImage returns an image from DB.
GetImageSize returns the size of image.
NewServer returns a new image server.
RunMigrations runs all the migrations in migrations folder.
SaveImage saves the image in buf to disk (in a folder inside rootDir) and creates a record in images table.
ToJPEG converts the image to a JPEG, if it's not already, and fits the image into maxWidth and maxHeight according to fit.
UnmarshalConfigFile reads the config in file and returns it.

# Constants

ImageFitContain fits the image in the container without either enlarging the image or cropping it.
ImageFitCover covers the given container with the image.
Valid ImageFit values.
List of image types.
List of image types.
MaxImagesPerFolder sets the maximum number of image files (without counting copies) that can be saved in one folder.

# Variables

# Structs

Config is the configuration for the HTTP server.
DBImage is a record in the images table.
ImageCopy is a copy of an image.
ImageSize represents the size of an image.
RGB represents color values of range (0, 255).
SaveImageArg is an argument to SaveImage.
Server is an HTTP server that processes and serves images.

# Type aliases

ImageFit denotes how an image is to be fitted into a rectangle.
ImageType represents the type of image.