Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renewal of the shiny interface #56

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

jkeuskamp
Copy link

To facilitate renewal of the shiny interface two small changes were made to increase loading speed and predictability of thumbnails.

jkeuskamp added 4 commits April 23, 2017 23:47
Added the possibility to pre-process thumbnails, which improves the
speed if having to use locate_area on a large number of files
Thumbnails are named by their file of origin with page number as
suffix. By default files are renamed such that the page suffix contains
the same number of characters for all thumbnails (01,02,…,10,11). As a
result the first thumbnail could either be called <somename>1.ext or
<somename>01.ext or even <somename>001.ext, making it harder to pick up
these files downstream. Here an option is added to change this
behaviour so that the first thumbnail is always called <somename>1.ext
@@ -53,9 +54,16 @@ function(file, pages = NULL, resolution = 60L, widget = c("shiny", "native", "re
file <- localize_file(file, copy = TRUE)
on.exit(unlink(file), add = TRUE)
dims <- get_page_dims(file, pages = pages)

if (!is.null(thumbnails)){
Copy link
Member

Choose a reason for hiding this comment

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

Add space between ){.

file.copy(filelist, tempdir(),overwrite=T)
paths <-file.path(tempdir(),basename(filelist))
cat('fetching files')
} else if (is.null(thumbnails)){
Copy link
Member

Choose a reason for hiding this comment

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

Add space between ){.

@@ -97,7 +105,7 @@ function(file, pages = NULL, resolution = 60L, widget = c("shiny", "native", "re
#' @rdname extract_areas
#' @export
extract_areas <- function(file, pages = NULL, guess = FALSE, ...) {
areas <- locate_areas(file = file, pages = pages)
areas <- locate_areas(file = file, pages = pages, thumbnails = NULL, resolution = 60L, widget = c("shiny", "native", "reduced"))
Copy link
Member

Choose a reason for hiding this comment

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

Why did this line change?

@@ -48,6 +49,6 @@ function(file, outdir = NULL, pages = NULL, format = c("png", "jpeg", "bmp", "gi
PDFImageWriter$writeImage(pdfDocument, format, "", pages[i], pages[i],
prefix, 1L, as.integer(resolution))
}
file.rename(from = paste0(prefix, pages, ".", format), to = outfile)
ifelse(file.exists(outfile), outfile, NA_character_)
if(isTRUE(uniform)){file.rename(from = paste0(prefix, pages, ".", format), to = outfile)
Copy link
Member

Choose a reason for hiding this comment

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

Spread this out across multiple lines with spacing between brackets:

if (condition) {
 code
}

@@ -6,6 +6,7 @@
#' @param format A character string specifying an image file format.
#' @param resolution An integer specifying the image resolution in DPI.
#' @param password Optionally, a character string containing a user password to access a secured PDF.
#' @param uniform determines whether the page numbers suffixes of generated thumbnails have a uniform (01,02,...,10) or short (1,2,...,10) format.
Copy link
Member

Choose a reason for hiding this comment

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

Capitalize "Determines"

@pachadotdev
Copy link
Contributor

I will need to check the changes with tabula 1.0.5

@pachadotdev pachadotdev changed the title Master renewal of the shiny interface Apr 11, 2024
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.

None yet

3 participants