Package 'kwb.iview'

Title: Interface to IrfanView
Description: Wrapper functions to IrfanView functionality.
Authors: Hauke Sonnenberg [aut, cre] (ORCID: <https://orcid.org/0000-0001-9134-2871>), Michael Rustler [ctb] (ORCID: <https://orcid.org/0000-0003-0647-7726>), Kompetenzzentrum Wasser Berlin gGmbH [cph]
Maintainer: Hauke Sonnenberg <[email protected]>
License: MIT + file LICENSE
Version: 0.0.99
Built: 2026-06-07 10:27:32 UTC
Source: https://github.com/KWB-R/kwb.iview

Help Index


Append Images Horizontally or Vertically

Description

Append Images Horizontally or Vertically

Usage

appendImages(
  files,
  direction,
  file,
  run = TRUE,
  irfanViewExe = defaultIrfanViewExe()
)

Arguments

files

paths to image files to be appended

direction

1 = horizontally, 2 = vertically

file

name of output file

run

logical. If TRUE (default) the append action is performed, otherwise the command line doing the append action is returned

irfanViewExe

path to IrfanView Executable file


Convert Image to Format

Description

Convert Image to Format

Usage

convertToFormat(
  imagepath,
  format,
  outputdir = dirname(imagepath),
  wait = TRUE,
  irfanViewExe = defaultIrfanViewExe()
)

Arguments

imagepath

full path to image file to be converted

format

file extension of target format (without ".", e.g. "jpg", "bmp", ...)

outputdir

output directory where converted image is to be saved. Per default the file is created in the directory of imagepath

wait

passed to shell

irfanViewExe

path to IrfanView Executable


Use IrfanView to Crop the Image and Set Borders

Description

Use IrfanView to Crop the Image and Set Borders

Usage

cropImageAndSetBorders(
  inputdir,
  outputdir,
  irfanViewExe = defaultIrfanViewExe(),
  crop = c(left = 0, top = 0, width = -1, height = -1),
  border = c(left = 0, right = 0, top = 0, bottom = 0),
  canvasColor = 255,
  useIni = TRUE,
  wait = FALSE,
  inputPattern = "*.gif"
)

Arguments

inputdir

full input path including file name or pattern, e.g. "*.png", "*.gif"

outputdir

full output path including file name or pattern, e.g. "*.pgm"

irfanViewExe

path to IrfanView Executable File

crop

vector of four integers (left, top, width, height): optional coordinates for cropping. If crop["left"] != -1 the image will be cropped, otherwise not.

border

vector of four integers (left, right, top, bottom)

canvasColor

passed to kwb.iview:::writeIniFile

useIni

logical. If TRUE (default) an INI file is written and IrfanView is called with the /ini option on the command line

wait

passed to shell.

inputPattern

file name pattern matching the files in inputdir to be processed


Default Path to the IrfanView Executable File

Description

Default Path to the IrfanView Executable File

Usage

defaultIrfanViewExe()

Content for INI File Specifying Crop Action

Description

Content for INI File Specifying Crop Action

Usage

iniContentCrop(
  crop = c(left = 0, top = 0, width = -1, height = -1),
  border = c(left = 0, right = 0, top = 0, bottom = 0),
  canvasColor = 255
)

Arguments

crop

integer vector with elements named left, top, width, height

border

integer vector with elements named left, right, top, bottom

canvasColor

value used in IrvanView [Effects] option CanvColor


Assignement to be Used in INI File

Description

Assignement to be Used in INI File

Usage

iniFileAssignment(optname, optvalue)

Arguments

optname

name of option

optvalue

value of option


Write INI File and Return Option String

Description

Write INI File and Return Option String

Usage

writeIniFile(outputdir, crop, border, canvasColor, filename = "i_view32.ini")

Arguments

outputdir

output directory

crop

passed to kwb.iview:::iniContentCrop

border

passed to kwb.iview:::iniContentCrop

canvasColor

passed to kwb.iview:::iniContentCrop

filename

name of INI file

Value

option string required to tell IrfanView to use the INI file