The trivial-thumbnail Reference Manual

This is the trivial-thumbnail Reference Manual, version 1.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sat Dec 03 23:34:38 2022 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 trivial-thumbnail

Tiny library to create image thumbnails with imagemagick.

Maintainer

Nicolas Hafner <>

Author

Nicolas Hafner <>

Home Page

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

Source Control

(GIT https://github.com/Shinmera/trivial-thumbnail.git)

Bug Tracker

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

License

zlib

Version

1.1.0

Dependency

uiop (system).

Source

trivial-thumbnail.asd.

Child Component

thumbnail.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 trivial-thumbnail/trivial-thumbnail.asd

Source

trivial-thumbnail.asd.

Parent Component

trivial-thumbnail (system).

ASDF Systems

trivial-thumbnail.


3.1.2 trivial-thumbnail/thumbnail.lisp

Source

trivial-thumbnail.asd.

Parent Component

trivial-thumbnail (system).

Packages

trivial-thumbnail.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 trivial-thumbnail

Source

thumbnail.lisp.

Nicknames
  • org.tymoonnext.trivial-thumbnail
  • thumbnail
Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


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.

Special Variable: *mogrify-bin*

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

Package

trivial-thumbnail.

Source

thumbnail.lisp.


5.1.2 Ordinary 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.

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 Same as :CONTAIN
:CONTAIN Scale the image to fit the larger dimension.
:COVER Scale the image to fit the lower dimension, then crop. :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.

Function: mogrify (in &rest args)

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

Package

trivial-thumbnail.

Source

thumbnail.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: binary-alternatives (binary-name)

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

Package

trivial-thumbnail.

Source

thumbnail.lisp.

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.

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.


Appendix A Indexes


A.1 Concepts