Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rossarmstrong committed Feb 2, 2023
1 parent 21d690c commit 86506c1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions R/mod_create_image.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ mod_create_image_server <- function(id) {
## START - MY CODE
output$openaiResponse <- renderImage({
url <- get_url(input$createimage, input$imagesizes)
filename <- paste("inst/app/www",get_filename(url), sep = "/")
download.file(url,filename, mode = "wb")
filename <- paste("inst/app/www", get_filename(url), sep = "/")
download.file(url, filename, mode = "wb")
img_dimension <- as.numeric(sapply(strsplit(input$imagesizes, "x"), getElement, 1))
list(src = filename, contentType = "image/png",width = img_dimension, height = img_dimension,
list(src = filename, contentType = "image/png", width = img_dimension, height = img_dimension,
alt = input$createimage)
}, deleteFile = FALSE) |>
bindEvent(input$buttonCreateImage)
Expand Down
2 changes: 1 addition & 1 deletion R/mod_show_gallery.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod_show_gallery_server <- function(id) {
ns <- session$ns

## START - MY CODE
output$module_body = renderUI({
output$module_body <- renderUI({
number_images <- length(get_images())
image_splits <- split(get_images(), cut(seq_along(get_images()), 4, labels = FALSE))
fluidRow(
Expand Down
2 changes: 1 addition & 1 deletion R/mod_show_instructions.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod_show_instructions_ui <- function(id) {
p("After you have saved your API Key, click on the ", em("Create Image"), "tab."),
p("In the text box, enter your description of the image that you would like produced."),
p("Images can be generated in three sizes (in pixels):"),
tags$ul(tags$li("256 x 256"),tags$li("512 x 512"),tags$li("1024 x 1024")),
tags$ul(tags$li("256 x 256"), tags$li("512 x 512"), tags$li("1024 x 1024")),
p("The images are created in a png format."),
hr(),
h4("Step 3 - View all images created"),
Expand Down
2 changes: 1 addition & 1 deletion dev/02_dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

## Dependencies ----
## Amend DESCRIPTION with dependencies read from package code parsing
## install.package('attachment') # if needed. # The s is missing on package/s
## install.package('attachment')
install.packages("attachment")
attachment::att_amend_desc()
## Add one line by package you want to add as dependency"
Expand Down

0 comments on commit 86506c1

Please sign in to comment.