mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: respect PREVIEW.image_quality for the default PDF previewer (#2006)
Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
parent
3bd625a8af
commit
adb1426539
2 changed files with 10 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ function M:preload(job)
|
||||||
"-resize",
|
"-resize",
|
||||||
string.format("%dx%d^", PREVIEW.max_width, PREVIEW.max_height),
|
string.format("%dx%d^", PREVIEW.max_width, PREVIEW.max_height),
|
||||||
"-quality",
|
"-quality",
|
||||||
tostring(PREVIEW.image_quality),
|
PREVIEW.image_quality,
|
||||||
"-auto-orient",
|
"-auto-orient",
|
||||||
"JPG:" .. tostring(cache),
|
"JPG:" .. tostring(cache),
|
||||||
}):status()
|
}):status()
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,15 @@ function M:preload(job)
|
||||||
end
|
end
|
||||||
|
|
||||||
local output = Command("pdftoppm")
|
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)
|
:stdout(Command.PIPED)
|
||||||
:stderr(Command.PIPED)
|
:stderr(Command.PIPED)
|
||||||
:output()
|
:output()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue