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

add support for Image creation from string image data #937

Merged
merged 2 commits into from
Dec 13, 2016

Conversation

troosan
Copy link
Contributor

@troosan troosan commented Nov 8, 2016

This change allows us to create an PhpOffice\PhpWord\Element\Image from a string representing the image data.

        $source = file_get_contents(__DIR__ . '/../_files/images/earth.jpg');
        $image = new Image($source);

Of course in real life $source would come from a DB for instance.

Thanks to this you do not have to write the image data to file before passing it to the constructor.
This solves issue #921

@Progi1984
Copy link
Member

@troosan Good job in the MR. Tests units & Code are 👍 . Could you add some documentation, before the merge ? Thanks

@troosan troosan closed this Dec 12, 2016
@troosan troosan reopened this Dec 12, 2016
@troosan
Copy link
Contributor Author

troosan commented Dec 13, 2016

@Progi1984 I updated the documentation but for whatever reason the build is failing now. The build is taking forever and finally php-doc fails to be executed.
Is there something wrong with what I committed or is there something wrong with Travis?

@Progi1984
Copy link
Member

@troosan Perfect. PhpDoc has some bugs currently, I don't care about it in my review.

@Progi1984 Progi1984 merged commit c4c35dd into PHPOffice:develop Dec 13, 2016
@Progi1984 Progi1984 self-assigned this Dec 13, 2016
@Progi1984 Progi1984 added this to the v0.14.0 milestone Dec 13, 2016
@troosan troosan deleted the image_from_string branch July 10, 2017 23:51
@troosan troosan mentioned this pull request Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants