Image.Options.Open (image v0.59.2)

View Source

Options and option validation for Image.open/2.

Summary

Types

Stop attempting to load an image file when a level of error is detected. The default is :none.

The file access mode when opening image files. The default in :sequential.

The options applicable to opening an image.

The number of pages to open. Either a positive integer or one of -1 or :all meaning all pages.

Types

fail_on()

@type fail_on() :: :none | :truncated | :error | :warning

Stop attempting to load an image file when a level of error is detected. The default is :none.

Each error state implies all the states before it such that :error implies also :truncated.

file_access()

@type file_access() :: :sequential | :random

The file access mode when opening image files. The default in :sequential.

gif_open_options()

@type gif_open_options() :: [
  access: file_access(),
  fail_on: fail_on(),
  pages: pages(),
  page: 0..100_000
]

image_open_options()

The options applicable to opening an image.

jpeg_open_options()

@type jpeg_open_options() :: [
  shrink: 1..16,
  access: file_access(),
  fail_on: fail_on()
]

other_open_options()

@type other_open_options() :: [access: file_access(), fail_on: fail_on()]

pages()

@type pages() :: pos_integer() | -1 | :all

The number of pages to open. Either a positive integer or one of -1 or :all meaning all pages.

png_open_options()

@type png_open_options() :: [access: file_access(), fail_on: fail_on()]

tiff_open_options()

@type tiff_open_options() :: [
  access: file_access(),
  fail_on: fail_on(),
  pages: pages(),
  page: 1..100_000
]

webp_open_options()

@type webp_open_options() :: [
  access: file_access(),
  fail_on: fail_on(),
  pages: pages(),
  page: 0..100_000,
  scale: non_neg_integer() | float()
]

Functions

validate_option(option, options)

validate_options(options)