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

broken xls writer: lost EMF embed image #274

Closed
1 of 3 tasks
SailorMax opened this issue Nov 14, 2017 · 7 comments
Closed
1 of 3 tasks

broken xls writer: lost EMF embed image #274

SailorMax opened this issue Nov 14, 2017 · 7 comments
Labels

Comments

@SailorMax
Copy link
Contributor

SailorMax commented Nov 14, 2017

This is:

What is the expected behavior?

Readable XLS file with embed image.

What is the current behavior?

If open in Excel, XLS file with broken image.
If try to read it by PhpSpreadsheet, we've got:

Uncaught Error: Call to a member function getBlipType() on null in lib\PHPOffice\PHPSpreadsheet\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Reader\Xls.php:1137

$BSECollection is empty array.

What are the steps to reproduce?

<?php

require __DIR__ . '/vendor/autoload.php';

$fileType = 'Xlsx';
$fileName = __DIR__.'/imgBook1.xlsx';

// Read the file
$objReader = PhpOffice\PhpSpreadsheet\IOFactory::createReader("Xlsx");
$objPHPExcel = $objReader->load($fileName);

$output_type = "Xls";
$output_file_name = __DIR__.'/output';
$objWriter = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($objPHPExcel, $output_type);
$objWriter->save($output_file_name);

$outputReader = PhpOffice\PhpSpreadsheet\IOFactory::createReader($output_type);
$outputPHPExcel = $outputReader->load($output_file_name);

imgBook1.xlsx
Sample Xlsx with 1 embed EMF picture.

Which versions of PhpSpreadsheet and PHP are affected?

sources from 13.11.2017
PHP 7.2.0rc6

@PowerKiKi
Copy link
Member

Please provide a Minimal, Complete, and Verifiable example of code without relying on an external Excel file.

@SailorMax
Copy link
Contributor Author

@PowerKiKi
"lost EMF embed image"
Create new document in any editor, put in it EMF file and convert it to xls via PHPSpreadsheet.
How I can write example without external file? EMF file from where to get?
I did easier - prepared sample xlsx.

@stale
Copy link

stale bot commented Feb 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Feb 16, 2018
@SailorMax
Copy link
Contributor Author

will recheck later

@stale stale bot removed the stale label Feb 16, 2018
@stale
Copy link

stale bot commented Apr 17, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Apr 17, 2018
@SailorMax
Copy link
Contributor Author

Looks like not critical for everyone. Can be forgotten.
May be I will try to fix it later by myself.

@stale stale bot removed the stale label Apr 17, 2018
@stale
Copy link

stale bot commented Jun 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants