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

Feature request: Support EMF image #490

Open
erswelljustin opened this issue Aug 1, 2018 · 12 comments
Open

Feature request: Support EMF image #490

erswelljustin opened this issue Aug 1, 2018 · 12 comments

Comments

@erswelljustin
Copy link

erswelljustin commented Aug 1, 2018

I am trying to use PhpPresentation to read a sample.pptx file using the simple instructions for readers in the docs and I am getting:

imagecreatefromstring(): Data is not in a recognized format

I have checked that I have PHP7.2-gd installed and all of the other dependencies.

My Code:

require_once 'vendor/autoload.php';

use \PhpOffice\PhpPresentation\PhpPresentation;
use \PhpOffice\PhpPresentation\IOFactory;
use \PhpOffice\PhpPresentation\Style\Color;
use \PhpOffice\PhpPresentation\Style\Alignment;

$oReader = IOFactory::createReader('PowerPoint2007');
$data = $oReader->load(__DIR__ . '/sample.pptx');
var_dump($data);

Can anybody help me understand the issue?

The file with the issue is vendor/phpoffice/phppresentation/src/PhpPresentation/Reader/PowerPoint2007.php

@Progi1984
Copy link
Member

@erswelljustin Which sample.pptx do you use ?

@Progi1984 Progi1984 added this to the Waiting For Answer milestone Oct 3, 2018
@MrAlexEvers
Copy link

MrAlexEvers commented Oct 24, 2018

I have the exact same issue, with practically the exact same code.

Stackoverflow suggests that the imagecreatefromstring function only handles several image formats.
This is a native PHP function, so I fear a solution might take a while, but I'm looking forward to see if this can/will be solved.

@Progi1984
Copy link
Member

@MrAlexEvers Have you got a sample file ?

@MrAlexEvers
Copy link

@Progi1984 The presentations I'm using are from my client, which I fear I am not at liberty to share.
But it contains a .emf file, which cannot be handled by imagecreatefromstring()

@Progi1984 Progi1984 changed the title imagecreatefromstring(): Data is not in a recognized format Feature request: Support EMF image Oct 24, 2018
@Progi1984
Copy link
Member

Thanks. I will transform in feature request.

References :

@nikolajlovenhardt
Copy link

nikolajlovenhardt commented Oct 5, 2020

Feel free to get inspiration from https://github.com/nikolajlovenhardt/PHPPresentation/releases/tag/0.10.0

I added support for the TIFF format by converting the image using Imagick.

@Progi1984
Copy link
Member

@erswelljustin @MrAlexEvers @nikolajlovenhardt If you have a basic file with EMF/WMF image, I'm interested to add this feature to the reader of the library.

@MrAlexEvers
Copy link

@Progi1984 What a blast from the past, this was a request from 5 years ago. I eventually also used an image converter for my EMF issue.

@Progi1984
Copy link
Member

@MrAlexEvers Sorry. I'm mainly alone for maintaining this library.

If you have a file, I can continue on it.

@MrAlexEvers
Copy link

@Progi1984 I've since given up my developer carreer, I'm afraid.

@Progi1984
Copy link
Member

@MrAlexEvers No problem. Thank you for your answer.

@Progi1984 Progi1984 added this to the 1.1.0 milestone Aug 21, 2024
@Progi1984 Progi1984 modified the milestones: 1.1.0, 1.2.0 Sep 1, 2024
@Progi1984
Copy link
Member

Partially linked to #756
Linked to #741

New repository : https://github.com/PHPOffice/WMF

  • ✔️ Support of WMF files
  • 🚧 Support of EMF files

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

No branches or pull requests

4 participants