1
0
Fork 0

- captured error that could happens when making a image mosaic from a gemini page.

This commit is contained in:
cage 2022-12-11 12:59:41 +01:00
parent 3145ee8263
commit 7924136282
1 changed files with 40 additions and 35 deletions

View File

@ -1503,7 +1503,7 @@ It an existing file path is provided the command will refuse to run."
"Generate an image formed that contains all the images linked to a
gemini page and arranged in a grid layout, the resulting image is then
displayed using the standard image viewer installed on the system."
#+montage-bin
#+montage-bin
(when-let* ((window *message-window*)
(metadata (message-window:metadata window))
(links (gemini-viewer:gemini-metadata-links metadata))
@ -1526,6 +1526,7 @@ displayed using the standard image viewer installed on the system."
(map nil
(lambda (file uri)
(with-enqueued-process ()
(tui:with-notify-errors
(let ((data (gemini-client:slurp-gemini-url (gemini-parser:target uri))))
(info-message (format nil (_ "downloaded: ~a") (gemini-parser:target uri))
program-events:+maximum-event-priority+)
@ -1534,10 +1535,13 @@ displayed using the standard image viewer installed on the system."
:if-does-not-exist :error
:if-exists :supersede
:element-type filesystem-tree-window:+octect-type+)
(write-sequence data stream)))))
(write-sequence data stream))))))
files
images-uris)
(with-enqueued-process ()
(tui:with-notify-errors
(let ((error-message (misc:make-fresh-array 0 #\a 'character nil)))
(with-output-to-string (error-stream error-message)
(let* ((command-line (flatten (list "-title" (gemini-viewer:current-gemini-url)
"-frame" "5"
"-geometry"
@ -1547,6 +1551,7 @@ displayed using the standard image viewer installed on the system."
"-background" "Grey"
"-bordercolor" "SkyBlue"
"-mattecolor" "Lavender"
"-font" "Sans"
"-pointsize" "12"
(loop for name in names
for file in files
@ -1559,10 +1564,10 @@ displayed using the standard image viewer installed on the system."
:wait t
:input t
:output output-file
:error t)))
:error error-stream)))
(if (not (os-utils:process-exit-success-p process))
(error-message (_ "Error during images montage."))
(os-utils:xdg-open output-file)))))
(error-message (format nil (_ "Error during images montage: ~a.") error-message))
(os-utils:xdg-open output-file))))))))
#-montage-bin
(notify (_ "ImageMagick binaries not found on this system") :as-error t))