Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the trivial-thumbnail Reference Manual, version 1.0.0, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:42:32 2018 GMT+0.
• Introduction: | What trivial-thumbnail is all about | |
• Systems: | The systems documentation | |
• Files: | The files documentation | |
• Packages: | The packages documentation | |
• Definitions: | The symbols documentation | |
• Indexes: | Concepts, functions, variables and data types |
A tiny library to create thumbnails with ImageMagick. The binaries convert
and mogrify
need to be available on your system for this to work.
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: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The trivial-thumbnail system: |
Nicolas Hafner <shinmera@tymoon.eu>
Nicolas Hafner <shinmera@tymoon.eu>
Artistic
Tiny library to create image thumbnails with imagemagick.
1.0.0
trivial-thumbnail.asd (file)
thumbnail.lisp (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files: |
• The trivial-thumbnail.asd file: | ||
• The trivial-thumbnail/thumbnail.lisp file: |
Next: The trivial-thumbnail/thumbnail<dot>lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
trivial-thumbnail.asd
trivial-thumbnail (system)
Previous: The trivial-thumbnail<dot>asd file, Up: Lisp files [Contents][Index]
trivial-thumbnail (system)
thumbnail.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The trivial-thumbnail package: |
thumbnail.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions: | ||
• Internal definitions: |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables: | ||
• Exported functions: |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
String or pathname designating the location of the imagemagick CONVERT binary.
thumbnail.lisp (file)
String or pathname designating the location of the imagemagick MOGRIFY binary.
thumbnail.lisp (file)
Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Runs imagemagick’s CONVERT on IN with the result to OUT using the command-line ARGS.
thumbnail.lisp (file)
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.
thumbnail.lisp (file)
Runs imagemagick’s MOGRIFY on IN using the command-line ARGS.
thumbnail.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions: |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Return a list of poissible alternative locations for the specified binary.
thumbnail.lisp (file)
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.
thumbnail.lisp (file)
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.
thumbnail.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index: | ||
• Function index: | ||
• Variable index: | ||
• Data type index: |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L T |
---|
Jump to: | F L T |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | B C F L M R |
---|
Jump to: | B C F L M R |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S T |
---|
Jump to: | P S T |
---|