Class: Xberg::ImageOutputFormatJpeg

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
ImageOutputFormat
Defined in:
lib/xberg/native.rb

Overview

Re-encode all extracted images as JPEG at the given quality level.

quality must be in 1..=100. Values outside this range are clamped and a warning is emitted. Higher values produce larger files with less artefacting; 85 is a reasonable default.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#qualityObject (readonly)

Returns the value of attribute quality

Returns:

  • (Object)

    the current value of quality



2769
2770
2771
# File 'lib/xberg/native.rb', line 2769

def quality
  @quality
end

Class Method Details

.from_hash(hash) ⇒ Object



2791
2792
2793
# File 'lib/xberg/native.rb', line 2791

def self.from_hash(hash)
  new(quality: hash[:quality] || hash["quality"])
end

Instance Method Details

#heif?Boolean

Returns:

  • (Boolean)


2785
# File 'lib/xberg/native.rb', line 2785

def heif? = false

#jpeg?Boolean

Returns:

  • (Boolean)


2781
# File 'lib/xberg/native.rb', line 2781

def jpeg? = true

#native?Boolean

Returns:

  • (Boolean)


2777
# File 'lib/xberg/native.rb', line 2777

def native? = false

#png?Boolean

Returns:

  • (Boolean)


2779
# File 'lib/xberg/native.rb', line 2779

def png? = false

#svg?Boolean

Returns:

  • (Boolean)


2787
2788
2789
# File 'lib/xberg/native.rb', line 2787

def svg? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]

#webp?Boolean

Returns:

  • (Boolean)


2783
# File 'lib/xberg/native.rb', line 2783

def webp? = false