ambrevar/file: Add width and height methods.

master
Pierre Neidhardt 2021-01-17 13:05:24 +01:00
parent db62c9c845
commit 2effcf80a3
2 changed files with 13 additions and 1 deletions

View File

@ -304,3 +304,15 @@ See `%description'."
(defun mediafinder (root &rest predicates)
(let ((*finder-constructor* #'mediafile))
(apply #'finder root predicates)))
(export-always 'width)
(defmethod width ((file mediafile))
(ambrevar/ffprobe:width
(find-if #'plusp (media-streams file)
:key #'ambrevar/ffprobe:width)))
(export-always 'height)
(defmethod height ((file mediafile))
(ambrevar/ffprobe:height
(find-if #'plusp (media-streams file)
:key #'ambrevar/ffprobe:height)))

View File

@ -247,7 +247,7 @@ Example:
(apply #'%cmd<-> #'cmd> args))
(export-always 'tee)
(defun tee (input-stream)
(defun tee (input-stream) ; TODO: Real `tee' with separate process.
"Return the INPUT-STREAM and its string representation as a second value."
(let ((result
(uiop:slurp-stream-string input-stream :stripped t)))