Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

MemoryDrawing not working in HTML writer #808

Closed
Tomino2112 opened this issue Feb 3, 2016 · 2 comments
Closed

MemoryDrawing not working in HTML writer #808

Tomino2112 opened this issue Feb 3, 2016 · 2 comments

Comments

@Tomino2112
Copy link

Hi,

I am processing base64 image strings into Excel and HTML outputs.

This is the code:

$data = base64_decode(explode(',', $b64data)[1]);                   
                    $objDrawing = new PHPExcel_Worksheet_MemoryDrawing();
                    $objDrawing->setName('Sample image');
                    $objDrawing->setDescription('Sample image');
                    $objDrawing->setImageResource(imagecreatefromstring($data));
                    $objDrawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
                    $objDrawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT);
                    $objDrawing->setWidth(200);
                    $objDrawing->setHeight(200);
                    $objDrawing->setCoordinates($coord);
                    $objDrawing->setWorksheet($excelOb->getActiveSheet());

If I use Excel writer, image displays fine, but if I use HTML writer the image just doesnt bet processed. I had a little dig around the code, and found:

HTML.php:575

if ($drawing instanceof PHPExcel_Worksheet_Drawing) {

So obviously it seems that HTML writer ignores MemoryDrawings.

Is that correct? I could create pull request with fix when I have time, just want to make sure

Thanks

@Tomino2112
Copy link
Author

Created pull request #839

MarkBaker pushed a commit that referenced this issue Mar 1, 2016
… HTML writer

Manual merge of Pull Request
MarkBaker pushed a commit that referenced this issue Mar 1, 2016
… HTML writer

Manual merge of Pull Request
@MarkBaker
Copy link
Member

Merged manually, thank you for the PR

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

No branches or pull requests

2 participants