object ImageParser
- Alphabetic
- By Inheritance
- ImageParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bytesToBufferedImage(bytes: Array[Byte]): Option[BufferedImage]
Decodes raw image bytes into a BufferedImage.
Decodes raw image bytes into a BufferedImage.
- bytes
Raw image data (e.g. extracted from Word DOC/DOCX via Apache POI).
- returns
Option[BufferedImage] if the bytes can be decoded by ImageIO.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def decodeBase64(base64Str: String): Option[BufferedImage]
Decodes a base64-encoded string into a BufferedImage.
Decodes a base64-encoded string into a BufferedImage.
- base64Str
Base64 encoded string (without "data:image/png;base64," prefix).
- returns
Option[BufferedImage] if the bytes can be decoded by ImageIO.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fetchFromUrl(urlStr: String, connectTimeoutMs: Int = 1000, readTimeoutMs: Int = 1000, headers: Map[String, String] = Map.empty, maxRedirects: Int = 5): Option[BufferedImage]
Fetches an image from a remote URL and decodes it into a BufferedImage.
Fetches an image from a remote URL and decodes it into a BufferedImage.
Some CDNs (incl. Wikimedia) return 403 to non-browser clients without a descriptive User-Agent. We set one and handle redirects & error bodies.
- urlStr
Image URL (e.g. https://.../image.png)
- connectTimeoutMs
Connect timeout in milliseconds
- readTimeoutMs
Read timeout in milliseconds
- headers
Additional request headers
- maxRedirects
Max number of redirects to follow
- returns
Option[BufferedImage] if the stream can be decoded by ImageIO
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def renderPdfFile(pdfContent: Array[Byte]): Map[Int, Option[BufferedImage]]
Renders each page of a PDF document into a BufferedImage.
Renders each page of a PDF document into a BufferedImage.
- pdfContent
Raw PDF bytes.
- returns
Map of page index (0-based) to Option[BufferedImage] for each page that could be rendered. If a page cannot be rendered, its value will be None.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)