imagecodec

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 12 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 imagecodec converts images into a form the PDF writer can embed, decoding the source bytes and re-encoding them when the original format is not directly supported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Normalized

type Normalized struct {
	Bytes     []byte
	Extension extension.Type
	Width     int
	Height    int
}

Normalized is an image ready to embed: the encoded bytes, the format they are in, and the pixel size.

func NormalizeForPDF

func NormalizeForPDF(data []byte, ext extension.Type) (Normalized, error)

NormalizeForPDF returns data in a format the PDF writer can embed. JPEG and PNG pass through; other formats, including SVG, are rasterized to PNG.

func (Normalized) HasDimensions

func (n Normalized) HasDimensions() bool

HasDimensions reports whether both the width and height are known.

Jump to

Keyboard shortcuts

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