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

ConvertTo function is not working properly. No return #46

Open
sxaxmz opened this issue Apr 8, 2023 · 0 comments
Open

ConvertTo function is not working properly. No return #46

sxaxmz opened this issue Apr 8, 2023 · 0 comments

Comments

@sxaxmz
Copy link

sxaxmz commented Apr 8, 2023

Hi, Issue with using the tool as the error is with this part of the code as the command is not made properly and its not returning.

 public function convertTo($filename)
    {
        $outputExtension = pathinfo($filename, PATHINFO_EXTENSION);
        $supportedExtensions = $this->getAllowedConverter($this->extension);

        if (!in_array($outputExtension, $supportedExtensions)) {
            throw new OfficeConverterException("Output extension({$outputExtension}) not supported for input file({$this->basename})");
        }

        $outdir = $this->tempPath;
        $shell = $this->exec($this->makeCommand($outdir, $outputExtension));
        if (0 != $shell['return']) {
            throw new OfficeConverterException('Convertion Failure! Contact Server Admin.');
        }

        return $this->prepOutput($outdir, $filename, $outputExtension);
    }

The error:

Fatal error: Uncaught NcJoes\OfficeConverter\OfficeConverterException: Convertion Failure! Contact Server Admin. in C:\xampp\htdocs\vendor\ncjoes\office-converter\src\OfficeConverter\OfficeConverter.php:54
Stack trace:
#0 C:\xampp\htdocs\a\create_thumbnail.php(136): NcJoes\OfficeConverter\OfficeConverter->convertTo('Architecture_xy...')
#1 C:\xampp\htdocs\a\create_thumbnail.php(181): getThumbnail('../uploads/ppt/...', 'Architecture_xy...', 'C:/xampp/htdocs...', '../uploads/tmp/', 'ppt', '146', Object(mysqli))
#2 {main}
  thrown in C:\xampp\htdocs\vendor\ncjoes\office-converter\src\OfficeConverter\OfficeConverter.php on line 54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant