Skip to content

Commit b0c5e18

Browse files
committed
fix for images
1 parent 42dee20 commit b0c5e18

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: officer
33
Title: Manipulation of Microsoft Word and PowerPoint Documents
4-
Version: 0.7.2.006
4+
Version: 0.7.2.007
55
Authors@R: c(
66
person("David", "Gohel", , "david.gohel@ardata.fr", role = c("aut", "cre")),
77
person("Stefan", "Moog", , "moogs@gmx.de", role = "aut"),

R/post-proc.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,17 @@ sanitize_images <- function(x, warn_user = TRUE) {
215215

216216
for (doc_part in all_docs) {
217217
suppressWarnings({
218-
blip_nodes <- xml_find_all(doc_part$get(), "//a:blip[contains(@r:embed, 'rId')]|//asvg:svgBlip[contains(@r:embed, 'rId')]")
218+
blip_nodes <- xml_find_all(
219+
doc_part$get(),
220+
"//a:blip[contains(@r:embed, 'rId')]|//asvg:svgBlip[contains(@r:embed, 'rId')]",
221+
ns = c(
222+
"a" = "http://schemas.openxmlformats.org/drawingml/2006/main",
223+
"asvg" = "http://schemas.microsoft.com/office/drawing/2016/SVG/main",
224+
"r" = "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
225+
)
226+
)
219227
})
228+
220229
embed_list <- xml_attr(blip_nodes, "embed")
221230
embed_data <- filter(
222231
.data = doc_part$rel_df(),
@@ -226,6 +235,7 @@ sanitize_images <- function(x, warn_user = TRUE) {
226235
embed_data <- embed_data$target
227236
image_files[[length(image_files)+1]] <- embed_data
228237
}
238+
229239
image_files <- do.call(c, image_files)
230240
image_files <- unique(image_files)
231241

0 commit comments

Comments
 (0)