imagefile

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package imagefile tells what picture some bytes are and what file name to write them under, for every place that writes a picture out of a model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSVG

func CheckSVG(data []byte) error

CheckSVG is nil when data is one well-formed SVG document — a single root element svg in the SVG namespace and no text outside it — else why it is not.

func ContentType

func ContentType(data []byte) string

ContentType is the type data's signature gives when it is one of the images written (PNG, JPEG, GIF, BMP, WebP), image/svg+xml for one well-formed SVG document, or "" when data is no such image.

func Described

func Described(data []byte) string

Described is what DetectContentType says of bytes that are no image, for telling a reader what was found instead; a markup text says why it is no SVG.

func Name

func Name(name, fallback, ct string) string

Name is the file name for an image of type ct: the base of name, else of fallback, else "image", given the type's suffix unless it carries one already.

Types

This section is empty.

Jump to

Keyboard shortcuts

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