SvgoOptimizer

class SvgoOptimizer(logger: Logger, fileManager: FileManager) : Optimizer(source)

Optimize SVG files by using an external CLI tool called SVGO.

See also

Constructors

Link copied to clipboard
constructor(logger: Logger, fileManager: FileManager)

Properties

Link copied to clipboard
open override val allowedExtension: String

Represents the extension of file types that the optimizer can process.

Link copied to clipboard
open override val command: String

Represents the external command that will be used for optimization.

Link copied to clipboard
protected open val versionFlag: String

Represents the version flag argument used to verify the installation of the optimizers' software dependency by running the command with this flag.

Functions

Link copied to clipboard
open override fun run(file: Path): Path

Runs the optimization process on the given file, and returns a new Path of the optimized file.

Link copied to clipboard
protected fun runOptimization(errorCode: ErrorCode, vararg args: String)

Execute the optimization process by using external software dependency.

Link copied to clipboard

Checks if the required software for this optimizer is installed on the current system.