Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

[nextcloud] Including imagemagick extension? #133

Open
weikinhuang opened this issue Feb 24, 2017 · 11 comments
Open

[nextcloud] Including imagemagick extension? #133

weikinhuang opened this issue Feb 24, 2017 · 11 comments

Comments

@weikinhuang
Copy link

I've tried to add it to the build with:

BUILD_DEPS=... \
    imagemagick-dev \
    pcre-dev

NORMAL_APKS=...\
    imagemagick

pecl install ... \
    imagick

echo "extension=imagick.so" > /etc/php7.1/conf.d/imagick.ini

However everytime php runs (cli and fpm), I get a segmentation fault. Any help would be appreciated.

@Wonderfall
Copy link
Owner

I didn't want to integrate this extension because of many security issues in the past.
Your approach is good so I don't see why you get a segmentation fault. Can you verify you're building at least the version 3.4.3? https://pecl.php.net/package-changelog.php?package=imagick&release=3.4.3RC4

@weikinhuang
Copy link
Author

I am building 3.4.3 as that's the current head in pecl. Seems to be an issue with alpine maybe. As it doesn't work with php7-imagick when i replaced 7.1 with 7 in your image.

@Wonderfall
Copy link
Owner

I see... I don't have an explanation for now.
Perhaps you're using AppArmor, SELinux or Grsec?

@weikinhuang
Copy link
Author

I've tried it on my kubernetes cluster (CoreOS) and locally on boot2docker. Same issue, you can trigger the segmentation fault simply by doing php -i after enable imagick.

@Wonderfall
Copy link
Owner

I just built imagick for my image lychee and I don't have any segmentation fault (while I'm using apparmor). So I think it's likely coming from your side if it can help.

@weikinhuang
Copy link
Author

did you try docker run -it IMAGE sh then php -i

@Wonderfall
Copy link
Owner

My bad. Just tried running before but I can confirm docker run -ti image php7.1 -i output ends with Segmentation fault (core dumped).

Can you try to compile from https://github.com/mkoppanen/imagick ? I'm going to bed so I don't have time right now.

@ariselseng
Copy link

Imagick is used for previews in Nextcloud. It would be very nice to also have this in your image @Wonderfall. Maybe only as an option? If not, can you show an example of the best way to build upon your nextcloud image for extra php extensions.

@Wonderfall
Copy link
Owner

Mh, is imagick actually used by Nextcloud? I was not sure about that, though the documentation says it is.

A way to add imagick would be to add imagick to the pecl install list and then enable the extension just like I did for others. I'll take a look at that but first I'll have to get it working with Lychee.

@ariselseng
Copy link

@Wonderfall Yes, I wasn't aware of that too. If you see here: https://github.com/nextcloud/server/search?utf8=%E2%9C%93&q=imagick&type=
You will see a lot of references for imagick. It's mainly used for providing previews for files of certain filetypes. I use it a lot, along with my app: https://github.com/cowai/camerarawpreviews . Which gives previews to raw camera files as well as Adobe Indesign files, using "exiftool".

@tob123
Copy link

tob123 commented Oct 29, 2017

hi, i think weikinhuang was right that alpine and imagick combined had some bugs, but i think they have been fixed. giving the build another try gave me a working wonderfall/nextcloud build with imagick enabled. theming works now as well.
@Wonderfall are you willing to give it another shot and incorporate imagick into your build ?
Your nextcloud image is working very well!

Tobias.

P.S. I also think to nake in a config option to switch imagick off. I personally need the imagick module only during theming setup. once that is done the module could be switched off as far as i am concerned for my usecase.

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

No branches or pull requests

4 participants