Skip to content

Commit

Permalink
fix: respect PREVIEW.image_quality for the default PDF previewer (#…
Browse files Browse the repository at this point in the history
…2006)

Co-authored-by: sxyazi <[email protected]>
  • Loading branch information
gaesa and sxyazi authored Dec 7, 2024
1 parent 3bd625a commit adb1426
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion yazi-plugin/preset/plugins/magick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function M:preload(job)
"-resize",
string.format("%dx%d^", PREVIEW.max_width, PREVIEW.max_height),
"-quality",
tostring(PREVIEW.image_quality),
PREVIEW.image_quality,
"-auto-orient",
"JPG:" .. tostring(cache),
}):status()
Expand Down
10 changes: 9 additions & 1 deletion yazi-plugin/preset/plugins/pdf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ function M:preload(job)
end

local output = Command("pdftoppm")
:args({ "-singlefile", "-jpeg", "-jpegopt", "quality=75", "-f", tostring(job.skip + 1), tostring(job.file.url) })
:args({
"-singlefile",
"-jpeg",
"-jpegopt",
"quality=" .. PREVIEW.image_quality,
"-f",
job.skip + 1,
tostring(job.file.url),
})
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:output()
Expand Down

0 comments on commit adb1426

Please sign in to comment.