The trivial-thumbnail Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The trivial-thumbnail Reference Manual

This is the trivial-thumbnail Reference Manual, version 1.0.0, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:27:51 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Trivial-Thumbnail

A tiny library to create thumbnails with ImageMagick. The binaries convert and mogrify need to be available on your system for this to work.

How To

The main function to use is create.

(thumbnail:create #p"~/input.png" #p"~/input-thumb.png")
=> #p"~/input-thumb.png"

Of course it allows for different kinds of thumbnail generation with the crop argument:

(thumbnail:create #p"~/input.png" #p"~/input-thumb.png" :crop :WIDTH)
(thumbnail:create #p"~/input.png" #p"~/input-thumb.png" :crop :HEIGHT)
(thumbnail:create #p"~/input.png" #p"~/input-thumb.png" :crop T)

Using :WIDTH means that the image is first scaled down preserving the aspect ratio to fit into the given height and then crops the remaining width to fit the given width. :HEIGHT works similarly. T just crops the image without any scaling.

This library uses ImageMagick mostly because it can handle gif animations properly, which a lot of other tools cannot. Processing animation is calculation-intensive though, so if you want to disable that (resulting in a static gif), you can pass :preserve-gif NIL.

Trivial-Thumbnail attempts to locate the necessary binaries automatically, searching the usual paths such as /usr/bin, /usr/local/bin and C:/windows/system32/, C:/Program Files/ImageMagick*/. If it fails to find a suitable binary, it throws a warning at startup. When the binary is somewhere else, but still within your PATH, it should still work properly. Otherwise you will have to set *CONVERT-BIN* and *MOGRIFY-BIN* yourself.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 trivial-thumbnail

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shinmera/trivial-thumbnail

License

Artistic

Description

Tiny library to create image thumbnails with imagemagick.

Version

1.0.0

Source

trivial-thumbnail.asd (file)

Component

thumbnail.lisp (file)


Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 trivial-thumbnail.asd

Location

trivial-thumbnail.asd

Systems

trivial-thumbnail (system)


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 trivial-thumbnail/thumbnail.lisp

Parent

trivial-thumbnail (system)

Location

thumbnail.lisp

Packages

trivial-thumbnail

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 trivial-thumbnail

Source

thumbnail.lisp (file)

Nicknames
Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *convert-bin*

String or pathname designating the location of the imagemagick CONVERT binary.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)

Special Variable: *mogrify-bin*

String or pathname designating the location of the imagemagick MOGRIFY binary.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: convert IN OUT &rest ARGS

Runs imagemagick’s CONVERT on IN with the result to OUT using the command-line ARGS.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)

Function: create IN OUT &key WIDTH HEIGHT CROP QUALITY PRESERVE-GIF IF-EXISTS

Creates a thumbnail of IN with the result to OUT.

IN — A pathname or string to the source image. Strings are parsed using UIOP:PARSE-NATIVE-NAMESTRING.
OUT — A pathname or string to the source image or NIL. If NIL, OUT is the same as IN, with ’thumb-’ prefixed to the pathname-name.
WIDTH — The width of the thumbnail in pixels.
HEIGHT — The height of the thumbnail in pixels.
CROP — How to create the thumbnail. Can be one of the following:
NIL Scale the image, preserving the aspect ratio.
:WIDTH Scale the image to HEIGHT and crop the width down to fit WIDTH. :HEIGHT Scale the image to WIDTH and crop the height down to fit HEIGHT. T Crop the image width and height to fit WIDTH and HEIGHT. QUALITY — Percentage for the quality to use (0-100).
PRESERVE-GIF — Whether to run imagemagick with -coalesce, which preserves
GIF animations, but will take more time to compute.
IF-EXISTS — What to do if OUT exists. Can be one of the following:
NIL Don’t create a thumbnail and just return NIL.
:ERROR Signal an error.
:WARN Signal a warning.
:SUPERSEDE Overwrite the file.

Returns OUT.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)

Function: mogrify IN &rest ARGS

Runs imagemagick’s MOGRIFY on IN using the command-line ARGS.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: binary-alternatives BINARY-NAME

Return a list of poissible alternative locations for the specified binary.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)

Function: locate-binary LABEL &rest ALTERNATIVES

Iterates through the alternatives and, if one can be found by PROBE-FILE, sets the SYMBOL-VALUE of LABEL to that path. Otherwise signals a WARNING.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)

Function: run-program &rest ARGSLIST

Wrapper around UIOP:RUN-PROGRAM that returns the string output of the command and
passes the argslist to UIOP:ESCAPE-COMMAND. Also accepts a pathname as the executable designator.

Package

trivial-thumbnail

Source

thumbnail.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   T  
Index Entry  Section

F
File, Lisp, trivial-thumbnail.asd: The trivial-thumbnail<dot>asd file
File, Lisp, trivial-thumbnail/thumbnail.lisp: The trivial-thumbnail/thumbnail<dot>lisp file

L
Lisp File, trivial-thumbnail.asd: The trivial-thumbnail<dot>asd file
Lisp File, trivial-thumbnail/thumbnail.lisp: The trivial-thumbnail/thumbnail<dot>lisp file

T
trivial-thumbnail.asd: The trivial-thumbnail<dot>asd file
trivial-thumbnail/thumbnail.lisp: The trivial-thumbnail/thumbnail<dot>lisp file

Jump to:   F   L   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   B   C   F   L   M   R  
Index Entry  Section

B
binary-alternatives: Internal functions

C
convert: Exported functions
create: Exported functions

F
Function, binary-alternatives: Internal functions
Function, convert: Exported functions
Function, create: Exported functions
Function, locate-binary: Internal functions
Function, mogrify: Exported functions
Function, run-program: Internal functions

L
locate-binary: Internal functions

M
mogrify: Exported functions

R
run-program: Internal functions

Jump to:   B   C   F   L   M   R  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*convert-bin*: Exported special variables
*mogrify-bin*: Exported special variables

S
Special Variable, *convert-bin*: Exported special variables
Special Variable, *mogrify-bin*: Exported special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

P
Package, trivial-thumbnail: The trivial-thumbnail package

S
System, trivial-thumbnail: The trivial-thumbnail system

T
trivial-thumbnail: The trivial-thumbnail system
trivial-thumbnail: The trivial-thumbnail package

Jump to:   P   S   T