diff --git a/R/class-workbook.R b/R/class-workbook.R index 6dff49a5a..42858fcb5 100644 --- a/R/class-workbook.R +++ b/R/class-workbook.R @@ -1080,6 +1080,18 @@ wbWorkbook <- R6::R6Class( # - Slicers if (external_wb) { + + # FIXME we copy all references from a workbook over to this workbook. + # This is not going to work, if multiple images from different + # workbooks are used. The references are called imageX.jpg and will + # overwrite each other. This needs a better solution + if (length(from$media)) { + if (!any(grepl("Default Extension=\"jpg\"", self$Content_Types))) { + self$append("Content_Types", "") + } + self$media <- append(self$media, from$media) + } + # update sheet styles style <- get_cellstyle(from, sheet = old) # only if styles are present