Skip to content

Conversation

@randomnoise
Copy link
Contributor

The change makes sure when user selects a book, the application prints file's path even if there is a problem on the process, it also prints an information about MuPDF's fz_count_pages function error.

Related to #376.

let page_count: i32 = mp_count_pages(self.ctx.0, self.doc);

if page_count <= 0 {
eprintln!("Error: MuPDF Fitz count_pages function returned {}.", page_count);
Copy link
Owner

Choose a reason for hiding this comment

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

MuPDF prints errors on stderr, so this shouldn't be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I understood correctly, Plato does not go that far in the process for MuPDF to throw an error and write it to stdout/stderr or to any .log file.

fz_count_pages and its subroutines look like they're fairly simple and don't throw errors, just return 0.

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.

2 participants