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

When image source is a link, return the link and don't give a PHP notice. #1997

Closed
jarrettj opened this issue Apr 12, 2021 · 1 comment
Closed

Comments

@jarrettj
Copy link
Contributor

This is:

- [ ] a bug report
- [x] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

Would be great if the image source URL is handled better. If it could be returned in someway? At the moment I use the following snippet to extract other images https://phpspreadsheet.readthedocs.io/en/latest/topics/recipes/#reading-images-from-a-worksheet.

What is the current behavior?

At the moment you receive a notice instead. See [PR 1970] #1970.

What are the steps to reproduce?

Open a file that contains images that have a URL as source.
You will get notices of the array index not being defined.

Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:

<?php

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

$inputFileType = IOFactory::identify($filePath);
$reader = IOFactory::createReader($inputFileType);
# Notices happen on load.
$spreadsheet = $reader->load($filePath);
$sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true);

Which versions of PhpSpreadsheet and PHP are affected?

1.17.1

@stale
Copy link

stale bot commented Jun 26, 2021

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 Jun 26, 2021
@oleibman oleibman removed the stale label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants