Skip to content

Commit

Permalink
Work around Imagemagick breakage, set time limit
Browse files Browse the repository at this point in the history
Generating thumbnails started crashing on my Arch system with a "time
limit exceeded" error, I suppose it's a breaking change in Imagemagick.
Setting the time limit explicitly gives it enough time to complete.
  • Loading branch information
ruuda committed Nov 5, 2023
1 parent d46580c commit 65590c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/thumb_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ impl<'a> GenThumb<'a> {
let out_path = get_tmp_fname(album_id);

let mut convert = Command::new("convert")
// Give Imagemagick enough time to open the image, recent versions
// are strict about it which leads to "time limit exceeded" error
// from "fatal/cache.c". The unit is seconds.
.args(["-limit", "time", "60"])
// Read from stdin.
.arg("-")
// Some cover arts have an alpha channel, but we are going to encode
Expand Down

0 comments on commit 65590c0

Please sign in to comment.