Skip to content

Comments

fix(index): add minVersion to pdfAttach options#750

Open
Fdawgs wants to merge 1 commit intomainfrom
fix/index-attach
Open

fix(index): add minVersion to pdfAttach options#750
Fdawgs wants to merge 1 commit intomainfrom
fix/index-attach

Conversation

@Fdawgs
Copy link
Owner

@Fdawgs Fdawgs commented Feb 19, 2026

pdfattach binary was introduced with Poppler 0.75.0. See https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/NEWS#L1475

Checklist

Copilot AI review requested due to automatic review settings February 19, 2026 15:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds minVersion: "0.75.0" to the printVersionInfo and replace options in the pdfAttach function configuration. According to the PR description, the pdfattach binary was introduced with Poppler version 0.75.0, so these options (and the entire binary) require at least this version.

Changes:

  • Added minVersion: "0.75.0" to printVersionInfo and replace options in the pdfAttach options object

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +763 to +768
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",
minVersion: "0.75.0",
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding minVersion to these options is correct, but the pdfAttach function (line 1248-1254) doesn't retrieve the version before calling parseOptions(), which means the minVersion validation will never execute. The function should call this.#getVersion(this.#pdfAttachBin) before parsing options, similar to how other functions like pdfFonts, pdfImages, pdfToPpm, etc. handle this (see lines 1288-1289, 1307-1308 for examples). Without this version retrieval, users could attempt to use these options with older Poppler versions that don't support them, and the error won't be caught.

Suggested change
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",
minVersion: "0.75.0",
},
replace: {
arg: "-replace",
type: "boolean",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant