Packages

object Utils

Functional utilities for image processing with safe IO using Either.

All operations that involve reading or writing files return Either[String, File], where Left(errorMessage) indicates failure and Right(file) indicates success.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Utils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def autoCrop(inputFile: File, outputFile: File, bgColor: Option[Color] = None): Either[String, File]

    Automatically crops an image, optionally using a color as the background reference, safely.

    Automatically crops an image, optionally using a color as the background reference, safely.

    inputFile

    the input file to crop

    outputFile

    the destination file

    bgColor

    optional Color used as background

    returns

    Either[String, File]

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  7. def convertToWebp(inputFiles: Seq[File], outputDir: File): Seq[Either[String, File]]

    Convert a list of images to WebP safely.

    Convert a list of images to WebP safely.

    inputFiles

    list of image files

    outputDir

    folder to save converted images

    returns

    sequence of Either[String, File]

  8. def convertToWebp(inputFile: File, outputDir: File): Either[String, File]

    Convert a single image to WebP safely.

    Convert a single image to WebP safely.

    inputFile

    the image file to convert

    outputDir

    folder to save the converted image

    returns

    Either an error message or the output File

  9. def createThumbnail(inputFiles: Seq[File], outputDir: File, thumbType: String): Seq[Either[String, File]]

    Generate thumbnails for a list of images safely.

    Generate thumbnails for a list of images safely.

    inputFiles

    list of image files

    outputDir

    folder to save thumbnails

    thumbType

    "desktop" or "mobile"

    returns

    sequence of Either[String, File]

  10. def createThumbnail(inputFile: File, outputDir: File, thumbType: String): Either[String, File]

    Generate a thumbnail for a single image safely.

    Generate a thumbnail for a single image safely.

    inputFile

    the image file

    outputDir

    folder to save thumbnail

    thumbType

    "desktop" or "mobile"

    returns

    Either an error message or the thumbnail File

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. def generatePlaceholders(number: Int, width: Int, height: Int, fillColor: Option[Color] = None, applyBlur: Boolean = true, outputDir: File): Seq[Either[String, File]]

    Generates a series of placeholder images safely.

    Generates a series of placeholder images safely.

    number

    the number of placeholder images to generate

    width

    width of each image

    height

    height of each image

    fillColor

    optional Color to fill the image; if None, transparent

    applyBlur

    whether to apply a blur effect

    outputDir

    folder to write placeholder images

    returns

    sequence of Either[String, File]

  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def listImages(inputDir: File): Seq[File]

    List all supported image files in a folder.

    List all supported image files in a folder.

    inputDir

    the folder to scan for image files

    returns

    sequence of valid image files

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. def stripMetadata(inputFile: File, outputFile: File): Either[String, File]

    Removes all metadata from an image and saves it as a clean PNG safely.

    Removes all metadata from an image and saves it as a clean PNG safely.

    inputFile

    the image file to process

    outputFile

    destination file for stripped image

    returns

    Either[String, File]

  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. object OCR

    Utility object for performing image preprocessing tasks for OCR.

    Utility object for performing image preprocessing tasks for OCR.

    This includes rotation correction, grayscale conversion, contrast adjustment, and optional binarization. All functions that manipulate pixels are pure and do not perform IO.

  28. object PaletteMaker

    palette maker

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped