View Source Image.Options.Open (image v0.47.0)

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

@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.

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

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

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

The options applicable to opening an image.

@type jpeg_open_options() :: [
  shrink: 1..16,
  access: file_access(),
  fail_on: fail_on()
]
@type other_open_options() :: [access: file_access(), fail_on: fail_on()]
@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.

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

Functions

Link to this function

validate_option(option, options)

View Source
Link to this function

validate_options(options)

View Source