Skip to content

Commit

Permalink
Fix blurry PDF rendering
Browse files Browse the repository at this point in the history
Fixes #1129
  • Loading branch information
johnfactotum committed Sep 28, 2024
1 parent 17c4fc8 commit 888c120
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@
<file>foliate-js/view.js</file>
<file>foliate-js/vendor/zip.js</file>
<file>foliate-js/vendor/fflate.js</file>
<file>foliate-js/vendor/pdfjs/pdf.js</file>
<file>foliate-js/vendor/pdfjs/pdf.worker.js</file>
<file>foliate-js/vendor/pdfjs/annotation_layer_builder.css</file>
<file>foliate-js/vendor/pdfjs/pdf.mjs</file>
<file>foliate-js/vendor/pdfjs/pdf.mjs.map</file>
<file>foliate-js/vendor/pdfjs/pdf.worker.mjs</file>
<file>foliate-js/vendor/pdfjs/pdf.worker.mjs.map</file>
<file>foliate-js/vendor/pdfjs/text_layer_builder.css</file>
<file>opds/main.js</file>
<file>opds/main.html</file>
<file>selection-tools/common.css</file>
Expand Down
1 change: 0 additions & 1 deletion src/reader/reader.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,4 @@
</form>
</div>
</dialog>
<script src="../foliate-js/vendor/pdfjs/pdf.js"></script>
<script src="reader.js" type="module"></script>
2 changes: 1 addition & 1 deletion src/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const registerPaths = (name, dirs) => registerScheme(name, req => {
? req.get_path().replace(/(?<=\/icons)\/hicolor(?=\/scalable\/)/, '')
: req.get_path()
if (dirs.every(dir => !path.startsWith(dir))) throw new Error()
const mime = path.endsWith('.js') ? 'application/javascript'
const mime = path.endsWith('.js') || path.endsWith('.mjs') ? 'application/javascript'
: path.endsWith('.svg') ? 'image/svg+xml' : 'text/html'
const file = Gio.File.new_for_uri(pkg.moduleuri(path))
req.finish(file.read(null), -1, mime)
Expand Down

0 comments on commit 888c120

Please sign in to comment.