Skip to content

fix imagick on alpine #497

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

Merged
merged 2 commits into from
May 20, 2020

Conversation

lifeofguenter
Copy link
Contributor

Currently alpine images have a broken imagick extension. The extension does not rely only on imagick libraries but a bunch of other libraries (libjpeg, libpng, etc.).

See:

Unless this was done on purpose to keep the base image size small? I would then either leave imagick out completely or add better documentation to this behaviour.

@tianon
Copy link
Member

tianon commented May 18, 2020

Currently alpine images have a broken imagick extension.

Can you please elaborate on this? (maybe a simple reproducer?)

The Debian images don't include the ImageMagick command-line utilities either, so if the Alpine images are broken, the Debian images should be too.

From what I can tell, the imagick PECL extension (appropriately) uses the ImageMagick libraries directly, and doesn't seem to shell out to convert and friends?

@lifeofguenter lifeofguenter changed the title fix imagick fix imagick on alpine May 18, 2020
@lifeofguenter
Copy link
Contributor Author

@tianon

 docker run -it --rm --entrypoint php wordpress:5.4-php7.4-fpm-alpine -r 'print_r(Imagick::queryFormats());'
Array
(
)

vs.

 docker run -it --rm --entrypoint php wordpress:5.4-php7.4-fpm -r 'print_r(Imagick::queryFormats());'
Array
(
    [0] => 3FR
    [1] => 3G2
    [2] => 3GP
    [3] => AAI
    [4] => AI
    [5] => ART
    [6] => ARW
    [7] => AVI
    [8] => AVS
    [9] => BGR
    [10] => BGRA
    [11] => BGRO
    [12] => BIE
    [13] => BMP
    [14] => BMP2
    [15] => BMP3
    [16] => BRF
    [17] => CAL
    [18] => CALS
    [19] => CANVAS
    [20] => CAPTION
    [21] => CIN
    [22] => CIP
    [23] => CLIP
    [24] => CMYK
    [25] => CMYKA
    [26] => CR2
    [27] => CRW
    [28] => CUR
    [29] => CUT
    [30] => DATA
    [31] => DCM
    [32] => DCR
    [33] => DCX
    [34] => DDS
    [35] => DFONT
    [36] => DNG
    [37] => DPX
    [38] => DXT1
    [39] => DXT5
    [40] => EPDF
    [41] => EPI
    [42] => EPS
    [43] => EPS2
    [44] => EPS3
    [45] => EPSF
    [46] => EPSI
    [47] => EPT
    [48] => EPT2
    [49] => EPT3
    [50] => ERF
    [51] => FAX
    [52] => FILE
    [53] => FITS
    [54] => FRACTAL
    [55] => FTP
    [56] => FTS
    [57] => G3
    [58] => G4
    [59] => GIF
    [60] => GIF87
    [61] => GRADIENT
    [62] => GRAY
    [63] => GRAYA
    [64] => GROUP4
    [65] => H
    [66] => HALD
    [67] => HDR
    [68] => HEIC
    [69] => HISTOGRAM
    [70] => HRZ
    [71] => HTM
    [72] => HTML
    [73] => HTTP
    [74] => HTTPS
    [75] => ICB
    [76] => ICO
    [77] => ICON
    [78] => IIQ
    [79] => INFO
    [80] => INLINE
    [81] => IPL
    [82] => ISOBRL
    [83] => ISOBRL6
    [84] => J2C
    [85] => J2K
    [86] => JBG
    [87] => JBIG
    [88] => JNG
    [89] => JNX
    [90] => JP2
    [91] => JPC
    [92] => JPE
    [93] => JPEG
    [94] => JPG
    [95] => JPM
    [96] => JPS
    [97] => JPT
    [98] => JSON
    [99] => K25
    [100] => KDC
    [101] => LABEL
    [102] => M2V
    [103] => M4V
    [104] => MAC
    [105] => MAGICK
    [106] => MAP
    [107] => MASK
    [108] => MAT
    [109] => MATTE
    [110] => MEF
    [111] => MIFF
    [112] => MKV
    [113] => MNG
    [114] => MONO
    [115] => MOV
    [116] => MP4
    [117] => MPC
    [118] => MPEG
    [119] => MPG
    [120] => MRW
    [121] => MSL
    [122] => MTV
    [123] => MVG
    [124] => NEF
    [125] => NRW
    [126] => NULL
    [127] => ORF
    [128] => OTB
    [129] => OTF
    [130] => PAL
    [131] => PALM
    [132] => PAM
    [133] => PATTERN
    [134] => PBM
    [135] => PCD
    [136] => PCDS
    [137] => PCL
    [138] => PCT
    [139] => PCX
    [140] => PDB
    [141] => PDF
    [142] => PDFA
    [143] => PEF
    [144] => PES
    [145] => PFA
    [146] => PFB
    [147] => PFM
    [148] => PGM
    [149] => PGX
    [150] => PICON
    [151] => PICT
    [152] => PIX
    [153] => PJPEG
    [154] => PLASMA
    [155] => PNG
    [156] => PNG00
    [157] => PNG24
    [158] => PNG32
    [159] => PNG48
    [160] => PNG64
    [161] => PNG8
    [162] => PNM
    [163] => PPM
    [164] => PREVIEW
    [165] => PS
    [166] => PS2
    [167] => PS3
    [168] => PSB
    [169] => PSD
    [170] => PTIF
    [171] => PWP
    [172] => RADIAL-GRADIENT
    [173] => RAF
    [174] => RAS
    [175] => RAW
    [176] => RGB
    [177] => RGBA
    [178] => RGBO
    [179] => RGF
    [180] => RLA
    [181] => RLE
    [182] => RMF
    [183] => RW2
    [184] => SCR
    [185] => SCT
    [186] => SFW
    [187] => SGI
    [188] => SHTML
    [189] => SIX
    [190] => SIXEL
    [191] => SPARSE-COLOR
    [192] => SR2
    [193] => SRF
    [194] => STEGANO
    [195] => SUN
    [196] => TEXT
    [197] => TGA
    [198] => THUMBNAIL
    [199] => TIFF
    [200] => TIFF64
    [201] => TILE
    [202] => TIM
    [203] => TTC
    [204] => TTF
    [205] => TXT
    [206] => UBRL
    [207] => UBRL6
    [208] => UIL
    [209] => UYVY
    [210] => VDA
    [211] => VICAR
    [212] => VID
    [213] => VIFF
    [214] => VIPS
    [215] => VST
    [216] => WBMP
    [217] => WEBP
    [218] => WMV
    [219] => WPG
    [220] => X
    [221] => X3F
    [222] => XBM
    [223] => XC
    [224] => XCF
    [225] => XPM
    [226] => XPS
    [227] => XV
    [228] => XWD
    [229] => YCbCr
    [230] => YCbCrA
    [231] => YUV
)
  • alpine behaves differently than non-alpine docker image, which in it alone is a regression/bug
  • imagemagick php extension alone does not really do much if it does not support a single input - and in that case it should rather not be installed in first place as it would give a wrong impression, as the normal use case would be to install imagemagick with more than 1 supported inputs
  • imagemagick php extension does not require "shelling out", but it still requires other libraries to function. By installing the imagemagick package, we ensure that all those libraries are included

@yosifkit
Copy link
Member

I see; it looks like the confusion comes from the Debian "imagemagick" package only containing the binaries like convert while the Alpine package for "imagemagick" contains those same binaries as well as many, many .so files 😞.

Copy link
Member

@yosifkit yosifkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! LGTM

Copy link
Member

@tianon tianon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@tianon tianon merged commit 2f49bc6 into docker-library:master May 20, 2020
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request May 20, 2020
Changes:

- docker-library/wordpress@2f49bc6: Merge pull request docker-library/wordpress#497 from lifeofguenter/feature/fix-imagick
- docker-library/wordpress@835fae9: put into main deps, add pr ref
- docker-library/wordpress@99f883f: fix imagick
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

Successfully merging this pull request may close these issues.

3 participants