scala-thumbnailer


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

com.themillhousegroup
ArtifactId

ArtifactId

scala-thumbnailer_2.12
Last Version

Last Version

0.5.1
Release Date

Release Date

Type

Type

jar
Description

Description

scala-thumbnailer
scala-thumbnailer
Project URL

Project URL

https://github.com/themillhousegroup/scala-thumbnailer
Project Organization

Project Organization

com.themillhousegroup
Source Code Management

Source Code Management

https://github.com/themillhousegroup/scala-thumbnailer

Download scala-thumbnailer_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.themillhousegroup/scala-thumbnailer_2.12/ -->
<dependency>
    <groupId>com.themillhousegroup</groupId>
    <artifactId>scala-thumbnailer_2.12</artifactId>
    <version>0.5.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.themillhousegroup/scala-thumbnailer_2.12/
implementation 'com.themillhousegroup:scala-thumbnailer_2.12:0.5.1'
// https://jarcasting.com/artifacts/com.themillhousegroup/scala-thumbnailer_2.12/
implementation ("com.themillhousegroup:scala-thumbnailer_2.12:0.5.1")
'com.themillhousegroup:scala-thumbnailer_2.12:jar:0.5.1'
<dependency org="com.themillhousegroup" name="scala-thumbnailer_2.12" rev="0.5.1">
  <artifact name="scala-thumbnailer_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.themillhousegroup', module='scala-thumbnailer_2.12', version='0.5.1')
)
libraryDependencies += "com.themillhousegroup" % "scala-thumbnailer_2.12" % "0.5.1"
[com.themillhousegroup/scala-thumbnailer_2.12 "0.5.1"]

Dependencies

compile (7)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.5
org.apache.pdfbox : pdfbox jar 2.0.3
org.imgscalr : imgscalr-lib jar 4.2
commons-io : commons-io jar 2.4
org.ostermiller : utils jar 1.07.00
fr.opensagres.xdocreport : org.apache.poi.xwpf.converter.pdf jar 1.0.2
com.typesafe.scala-logging : scala-logging_2.12 jar 3.5.0

Project Modules

There are no modules declared in this project.

scala-thumbnailer

A Scala library for generating thumbnails.

The API uses streams rather than files. Supports the following file types:

  • PDF
  • PNG, JPEG, GIF, BMP
  • DOCX
  • Plain text files

GPL v2.0

This fork exists to update the following versions:

  • Scala - v2.12 family
  • Apache PDFBox library dependency to the 2.x family
  • Typesafe Scala Logging to the 3.5.x family

... and get it published on Maven Central

Usage

Create

val defaultThumbnailer = new Thumbnailer
val thumbnailer = new Thumbnailer(new PDFThumbnailer, new TextThumbnailer)

Output to stream

val thumbnailer = new Thumbnailer
val input = new FileInputStream("input.pdf")
val output = new FileOutputStream("output.png", false)

thumbnailer.generateThumbnail(input, output, "application/pdf")

output.close
input.close

Output to byte array

val thumbnailer = new Thumbnailer
val input = new FileInputStream("input.pdf")

val bytes: Array[Byte] = thumbnailer.generateThumbnail(input, "application/pdf")

input.close

Options

val thumbnailer = new Thumbnailer
thumbnailer.setSize(100, 200)
thumbnailer.setShouldPadThumbnail(false)

Dependency Management

SBT

libraryDependencies += "com.themillhousegroup" %% "scala-thumbnailer" % "0.5.1"

Homepage

Originally inspired by java-thumbnailer.

Versions

Version
0.5.1