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

An issue with handling blip without embed #70

Open
savinskiy-konstantin opened this issue Aug 3, 2023 · 1 comment
Open

An issue with handling blip without embed #70

savinskiy-konstantin opened this issue Aug 3, 2023 · 1 comment

Comments

@savinskiy-konstantin
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Part of pptx slide structure:

<p:blipFill>
    <a:blip>
        <a:extLst>
            <a:ext uri="{79A0055B-C67C-407E-A111-50E730381C1C}">
                <a14:useLocalDpi
                    xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main"
                    val="0"/>
            </a:ext>
        </a:extLst>
    </a:blip>
    <a:srcRect/>
    <a:stretch>
        <a:fillRect/>
    </a:stretch>
</p:blipFill>

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/docx4js/lib/openxml/drawml/index.js b/node_modules/docx4js/lib/openxml/drawml/index.js
index 5096ddd..53f7dc9 100644
--- a/node_modules/docx4js/lib/openxml/drawml/index.js
+++ b/node_modules/docx4js/lib/openxml/drawml/index.js
@@ -64,6 +64,7 @@ exports.default = function (od) {
                 url = _n$attribs["r:link"];
 
             if (url) return { url: url };
+            if (!embed) return;
             var part = od.$(n).part();
             return new _part2.default(part, od.doc).getRel(embed);
         },
diff --git a/node_modules/docx4js/src/openxml/drawml/index.js b/node_modules/docx4js/src/openxml/drawml/index.js
index 23f665e..5c15bd6 100644
--- a/node_modules/docx4js/src/openxml/drawml/index.js
+++ b/node_modules/docx4js/src/openxml/drawml/index.js
@@ -17,6 +17,8 @@ export default od=>({
         const {attribs:{"r:embed":embed, "r:link":url}}=n
         if(url)
             return {url}
+        if(!embed)
+            return;
         const part=od.$(n).part()
         return new Part(part,od.doc).getRel(embed)
     },

This issue body was partially generated by patch-package.

@lalalic
Copy link
Owner

lalalic commented Sep 9, 2024

merged

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

No branches or pull requests

2 participants