Skip to content

Commit adb1426

Browse files
gaesasxyazi
andauthored
fix: respect PREVIEW.image_quality for the default PDF previewer (#2006)
Co-authored-by: sxyazi <[email protected]>
1 parent 3bd625a commit adb1426

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

yazi-plugin/preset/plugins/magick.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function M:preload(job)
2727
"-resize",
2828
string.format("%dx%d^", PREVIEW.max_width, PREVIEW.max_height),
2929
"-quality",
30-
tostring(PREVIEW.image_quality),
30+
PREVIEW.image_quality,
3131
"-auto-orient",
3232
"JPG:" .. tostring(cache),
3333
}):status()

yazi-plugin/preset/plugins/pdf.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ function M:preload(job)
2626
end
2727

2828
local output = Command("pdftoppm")
29-
:args({ "-singlefile", "-jpeg", "-jpegopt", "quality=75", "-f", tostring(job.skip + 1), tostring(job.file.url) })
29+
:args({
30+
"-singlefile",
31+
"-jpeg",
32+
"-jpegopt",
33+
"quality=" .. PREVIEW.image_quality,
34+
"-f",
35+
job.skip + 1,
36+
tostring(job.file.url),
37+
})
3038
:stdout(Command.PIPED)
3139
:stderr(Command.PIPED)
3240
:output()

0 commit comments

Comments
 (0)