image

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPosterHeight is the maximum height for poster images (optimized for Jellyfin/Plex/Emby)
	// Reduced from 1000px to 500px for better file sizes and performance
	MaxPosterHeight = 500

	// LandscapeAspectRatioThreshold determines if an image is landscape-oriented
	// Images with width/height > this value are considered landscape (typical JAV covers are ~1.5)
	LandscapeAspectRatioThreshold = 1.2
)

Variables

This section is empty.

Functions

func CropPosterFromCover

func CropPosterFromCover(fs afero.Fs, coverPath, posterPath string) error

CropPosterFromCover intelligently crops a cover image to create a poster

Strategy: - Landscape images (aspect ratio > 1.2): Crop right 47.2% (original Javinizer behavior) - Square/Portrait images (aspect ratio <= 1.2): Center crop to 2:3 aspect ratio - If result exceeds MaxPosterHeight, resize maintaining aspect ratio

This ensures good results for both wide JAV covers and square promotional images

func CropPosterWithBounds

func CropPosterWithBounds(fs afero.Fs, coverPath, posterPath string, left, top, right, bottom int) error

CropPosterWithBounds crops a cover image using explicit pixel bounds. Bounds are in source-image pixels and must be within the image dimensions.

Types

This section is empty.

Jump to

Keyboard shortcuts

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