format

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(size int64) string

Bytes returns a human-readable size string (e.g. "2.5 MB"). Negative sizes are formatted with a leading minus sign.

func DecodeDimensions

func DecodeDimensions(data []byte) (int, int)

DecodeDimensions parses image dimensions from the header bytes. It supports PNG, JPEG, GIF (via image.DecodeConfig), and WebP, BMP, TIFF (via manual magic-byte parsing). Returns 0x0 if the format is not recognized or the header is too short to extract dimensions.

func ImageDimensions

func ImageDimensions(data []byte) string

ImageDimensions decodes image dimensions from data for common image formats (PNG, JPEG, GIF, WebP, BMP, TIFF). Returns empty string for non-image or undecodable data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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