PhpSpreadsheet/tests/PhpSpreadsheetTests/Writer/Html
oleibman a32861a0a0
Copy from Xls(x) to Html/Pdf Loses Drawings (#2788)
Drawings in an Xlsx file are stored in such a way that Php can read their contents using the `zip:` protocol. This does not, however, work when the file is read by PhpSpreadsheet and then saved as Html or Pdf, since the browser will not recognize that protocol even if the file is available. Such drawings need to be saved in the html as embedded images in order for the copy to display them properly. This is true even when the writer is set to not embed images (default).

An additional problem arises when an Html file with an embedded image is read, because `Worksheet\Drawing::setPath` attempts to validate the path, which it cannot do for the `data:image` Url which embedded images use.

And yet another problem. Writer/Html writes out a MemoryDrawing as a png using the imagepng function; but then declares it as jpeg in the Html. This is now corrected.

And a fourth problem. Writer/Html ignores the last row if it contains nothing but a Memory Drawing, which can be true when copying an Xls file.

These changes are testable (it's how I discovered the second part of this parlay). I think it is also useful to add a sample to see the results of this type of copy.
2022-05-07 08:10:24 -07:00
..
AllOrOneSheetTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
CallbackTest.php Phpstan Differences from Php7 to Php8, Again (#2665) 2022-03-11 23:28:30 -08:00
ExtendForChartsAndImagesTest.php Don't ouput row and columns without any cells in HTML writer 2020-06-28 22:03:37 +09:00
GridlinesTest.php Phpstan Differences from Php7 to Php8, Again (#2665) 2022-03-11 23:28:30 -08:00
HtmlCommentsTest.php Phpstan Differences from Php7 to Php8, Again (#2665) 2022-03-11 23:28:30 -08:00
HtmlNumberFormatTest.php Changes to the default arguments for `htmlspecialchars()` and `html_entity_decode()` requires setting of the argument value explicitly to prevent changes in behaviour. (#2176) 2021-06-21 12:56:03 +02:00
ImageCopyTest.php Copy from Xls(x) to Html/Pdf Loses Drawings (#2788) 2022-05-07 08:10:24 -07:00
ImagesRootTest.php 2 Tests vs. Scrutinizer/Phpstan 2021-07-01 11:15:02 +02:00
InvalidFileNameTest.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
RepeatedRowsTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
VisibilityTest.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
XssVulnerabilityTest.php Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00