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

Imagick on PHP 5.6 can't read PDF files #714

Closed
thomasA4N opened this issue Aug 6, 2020 · 7 comments
Closed

Imagick on PHP 5.6 can't read PDF files #714

thomasA4N opened this issue Aug 6, 2020 · 7 comments
Assignees
Labels

Comments

@thomasA4N
Copy link

thomasA4N commented Aug 6, 2020

On PHP 5.6 Imagick can't read pdf files. It's not working with relative not even absolut path.

Example:

try {
	$im = new imagick();
	$im->setResolution(288,288);
	$im->readimage(realpath('test.pdf')); // relative path also doesn't works
} catch (Exception $e){
	echo $e->getMessage()."<br />\n"; // gets error "Failed to read the file"
}

test.pdf

@cytopia
Copy link
Owner

cytopia commented Aug 6, 2020

@thomasA4N can you submit some example code, I will then add it as a regression test here: https://github.com/devilbox/docker-php-fpm

@thomasA4N
Copy link
Author

@cytopia i have updated my comment ...

@cytopia
Copy link
Owner

cytopia commented Aug 6, 2020

Figured it already, it seems to be the lack of ghostscript. Once your stack is running, can you do the following in the PHP container:

sudo apt update
sudo apt install ghostscript -y

This should fix it for now. Will bundle it in the containers in the next release.

@thomasA4N
Copy link
Author

Thank you very much. I have tested that, and it's already works now.

Now, I will have to repeat that, after every restart of devilbox, didn't i?

@cytopia
Copy link
Owner

cytopia commented Aug 6, 2020

Now, I will have to repeat that, after every restart of devilbox, didn't i?

No, when you stop the container, the state will be preserved across restarts until you remove it explicitly (via docker-compose rm or docker rm)

@cytopia
Copy link
Owner

cytopia commented Aug 9, 2020

@thomasA4N will be fixed here: #711

@cytopia
Copy link
Owner

cytopia commented Aug 9, 2020

Merged and available in v1.7.1

@cytopia cytopia closed this as completed Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants