Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

fix image issue, eq. add image in 2 sheet, it make microsoft office t… #99

Merged
merged 1 commit into from
Nov 8, 2017

Conversation

ericlin716
Copy link
Contributor

…o warning with repair

@lteacher
Copy link

lteacher commented Sep 8, 2016

Have the same issue and just saw this. Appears to solve the problem

@vincent714
Copy link

Hi @amekkawi,
my colleague @ericlin716 has fixed the bug of the imge issue. could you please take a look and publish it for us on the npm?

Thanks.

@amekkawi
Copy link
Collaborator

Hi @vincent714, I am reviewing this PR but since I'm just starting to take on the excel4node library it's a slow start. We use this library for a critical internal application, but I don't want to make changes too hastily.

I do have a small checklist I would like to go through before I personally accept fix PRs. I'm not sure how many others have access to the repo, so I can only speak for myself 😄

  1. Code that reproduces the issue.
  2. If the PR is related to conforming to ECMA-376 OOXML, identify the part of the spec that is not being followed correctly.
  3. Identify tests that should be catching this issue. If they exist, fix them. If they do not exist, add new tests.

@vincent714
Copy link

Hi @amekkawi, thank you.
The procedure of reproducing the bug as follows,

  1. To insert one image in the sheet 1
  2. To insert the other image in the sheet 2
  3. Then open the file, you'll get the warning message.

Please let me know if you have any questions.

@dmechiche
Copy link

I have the same issue but @ericlin716 fix did not work for me.
Here is an example to reproduce:

// Create a new instance of a Workbook class 
var wb = new xl.Workbook();
// Add Worksheets to the workbook 
var ws1 = wb.addWorksheet('Divider 1');
var ws2 = wb.addWorksheet('Sheet 1');
var ws3 = wb.addWorksheet('Divider 2');
var ws4 = wb.addWorksheet('Sheet 2');
var ws5 = wb.addWorksheet('Divider 3');
var ws6 = wb.addWorksheet('Sheet 3');
var ws7 = wb.addWorksheet('Divider 4');
var ws8 = wb.addWorksheet('Sheet 4');
var ws9 = wb.addWorksheet('Sheet 5');

//Add divider images
ws1.addImage({
    path: './test/divider1.png',
    type: 'picture',
    position: {
        type: 'absoluteAnchor',
        x: '1in',
        y: '2in'
    }
});

ws3.addImage({
    path: './test/divider2.png',
    type: 'picture',
    position: {
        type: 'absoluteAnchor',
        x: '1in',
        y: '2in'
    }
});

ws5.addImage({
    path: './test/divider3.png',
    type: 'picture',
    position: {
        type: 'absoluteAnchor',
        x: '1in',
        y: '2in'
    }
});

ws7.addImage({
    path: './test/divider4.png',
    type: 'picture',
    position: {
        type: 'absoluteAnchor',
        x: '1in',
        y: '2in'
    }
});

wb.write('./test/out.xlsx')

@vincent714
Copy link

vincent714 commented Nov 28, 2016

@dmechiche did you use the version that @ericlin716 committed? I think that @amekkawi haven't merged the code yet. Hey @amekkawi, are u still there?

@ericlin716
Copy link
Contributor Author

HI @dmechiche, I use your sample code to try my solution and it work for me.

@aganoop
Copy link

aganoop commented Jan 12, 2017

I have the same issue. The sample is working fine with multiple images. But I copied all modules (source) to my code and it's not working for me. Please provide a merged code. Lot of people can use this. Thanks advance!!!!

@aganoop
Copy link

aganoop commented Jan 12, 2017

Please let me know, how we can debug the issue?

@ericlin716
Copy link
Contributor Author

@aganoop
Have you do the "num run build" command when the code is modified?

@aganoop
Copy link

aganoop commented Mar 28, 2017

No I am not tried with "num run build" but I have copied all the latest code to the "node_module" folder. Please let me know how I can integrate this fix to my project.

@aganoop
Copy link

aganoop commented Mar 28, 2017

I am getting the following error when I did "npm run build"

30387 error Windows_NT 6.1.7601
30388 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\anoop.ag\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install"
30389 error node v4.4.7
30390 error npm v3.10.7
30391 error code ELIFECYCLE
30392 error [email protected] prepublish: npm run build; npm run test
30392 error Exit status 1
30393 error Failed at the [email protected] prepublish script 'npm run build; npm run test'.
30393 error Make sure you have the latest version of node.js and npm installed.
30393 error If you do, this is most likely a problem with the excel4node package,
30393 error not with npm itself.
30393 error Tell the author that this fails on your system:
30393 error npm run build; npm run test
30393 error You can get information on how to open an issue for this project with:
30393 error npm bugs excel4node
30393 error Or if that isn't available, you can get their info via:
30393 error npm owner ls excel4node
30393 error There is likely additional logging output above.
30394 verbose exit [ 1, true ]

@vincent8766
Copy link

hi everyone, @amekkawi

I know this is an old thread but any chance this fix can be merged?

@gate5th
Copy link

gate5th commented Oct 2, 2017

I second merging this pull request - it's just a one liner and fixes a significant problem. Who would want to open a spreadsheet that excel warns may be corrupted?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants