Module: Cooltrainer::DistorteD::Molecule::SVG

Includes:
Technology::Vips::Save
Defined in:
lib/distorted/media_molecule/svg.rb

Constant Summary collapse

LOWER_WORLD =
Hash[
  CHECKING::YOU::OUT['image/svg+xml'] => Cooltrainer::DistorteD::Technology::Vips::vips_get_options(
    Cooltrainer::DistorteD::Technology::Vips::vips_foreign_find_load_suffix(".#{CHECKING::YOU::OUT['image/svg+xml'].preferred_extension}")
  ).merge(Hash[
    :optimize => Cooltrainer::Compound.new(:optimize, valid: Cooltrainer::BOOLEAN_VALUES, default: false, blurb: 'SvgOptimizer'),
  ])
]
OUTER_LIMITS =

WISHLIST: Support VML for old IE compatibility.

Example: Rapha
Hash[
  CHECKING::YOU::OUT['image/svg+xml'] => nil,
]

Constants included from Technology::Vips::Save

Technology::Vips::Save::VIPS_SAVERS

Instance Method Summary collapse

Instance Method Details

#to_vips_imageObject



30
31
32
33
34
35
# File 'lib/distorted/media_molecule/svg.rb', line 30

def to_vips_image
  # NOTE: libvips 8.9 added the `unlimited` argument to svgload.
  # Loading SVGs >= 10MiB in size will fail on older libvips.
  # https://github.com/libvips/libvips/commit/55e49831b801e05ddd974b1e2102fda7956c53f5
  @vips_image ||= Vips::Image.new_from_file(path)
end