scala-thumbnailer


License

License

Categories

Categories

Scala Languages
GroupId

GroupId

ch.wavein
ArtifactId

ArtifactId

scala-thumbnailer_2.12
Last Version

Last Version

0.7.1
Release Date

Release Date

Type

Type

jar
Description

Description

scala-thumbnailer
scala-thumbnailer
Project URL

Project URL

https://github.com/rphillips-nz/scala-thumbnailer
Project Organization

Project Organization

ch.wavein
Source Code Management

Source Code Management

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

Download scala-thumbnailer_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/ch.wavein/scala-thumbnailer_2.12/ -->
<dependency>
    <groupId>ch.wavein</groupId>
    <artifactId>scala-thumbnailer_2.12</artifactId>
    <version>0.7.1</version>
</dependency>
// https://jarcasting.com/artifacts/ch.wavein/scala-thumbnailer_2.12/
implementation 'ch.wavein:scala-thumbnailer_2.12:0.7.1'
// https://jarcasting.com/artifacts/ch.wavein/scala-thumbnailer_2.12/
implementation ("ch.wavein:scala-thumbnailer_2.12:0.7.1")
'ch.wavein:scala-thumbnailer_2.12:jar:0.7.1'
<dependency org="ch.wavein" name="scala-thumbnailer_2.12" rev="0.7.1">
  <artifact name="scala-thumbnailer_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='ch.wavein', module='scala-thumbnailer_2.12', version='0.7.1')
)
libraryDependencies += "ch.wavein" % "scala-thumbnailer_2.12" % "0.7.1"
[ch.wavein/scala-thumbnailer_2.12 "0.7.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.11 family
  • Apache PDFBox library dependency to the 2.x family
  • Typesafe Scala Logging to the 3.5.x family

No other code has changed.

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 += "nz.co.rossphillips" % "scala-thumbnailer" % "0.4.0"

Maven

<dependency>
	<groupId>nz.co.rossphillips</groupId>
	<artifactId>scala-thumbnailer</artifactId>
	<version>0.4.0</version>
</dependency>

Homepage

Originally inspired by java-thumbnailer.

Versions

Version
0.7.1