WordPress.org

Make WordPress Core

Opened 23 months ago

Closed 22 months ago

Last modified 19 months ago

#25183 closed enhancement (wontfix)

Let user choose between GD and ImageMagick

Reported by: fierevere Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Media Keywords: has-patch
Focuses: Cc:

Description

Since WP 3.5 default image editor extension can be choosen between Imagick and old good GD, choice is done automatically after simple test and Imagick is preferred.
User cannot choose which extension they like.
Some servers have buggy and unusable Imagick installed, while GD works, it will be nice to let user disable Imagick via wp-config.php define.

Simple patch provided.

Attachments (1)

wp-disable-imagick.patch (890 bytes) - added by fierevere 23 months ago.
simple patch for define('WP_DISABLE_IMAGICK')

Download all attachments as: .zip

Change History (8)

@fierevere23 months ago

simple patch for define('WP_DISABLE_IMAGICK')

comment:1 @nacin23 months ago

Some servers have buggy and unusable Imagick installed

Could you provide some information here? Rather than patching the symptom we'd rather target the actual problem — that is, we may not be detecting a "buggy and unusable" version of Imagick.

It shouldn't be necessary for the user to even think about how their images are getting resized and manipulated. We try to ensure we are working with a good version of Imagick — we require 2.2.0+, for example.

This is already feasible via the wp_image_editors filter, as in a plugin can serve this role. I don't think it is worth adding a constant, unless we really can't solve for buggy setups.

comment:2 @fierevere23 months ago

Actually a problem came from this topic - http://ru.forums.wordpress.org/topic/Изображения-загружаются-только-в-полном-размер/
(Russian)

brief: Images are not resized on upload, media editor tools (flip,resize etc) dont work
while phpinfo() shows a functional imagick extension, there is a problem with TEMP,TMP,TEMPDIR variables not set by hosting support (they are slow, so i tried to find some temporary workarounds), GD editor works, unless a JPEG image is too big (--enable-memlimit setting for libjpeg, when it tries to make a temporary file)
I expect a problem with Imagick ext is that TMP is not defined.
Wordpress had issues too, but it was solved by define( 'WP_TEMP_DIR', ABSPATH . '/tmp/') ;

imagick
imagick module	enabled
imagick module version 	3.0.1
imagick classes 	Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version 	ImageMagick 6.7.3-1 2011-10-12 Q16 http://www.imagemagick.org
ImageMagick copyright 	Copyright (C) 1999-2011 ImageMagick Studio LLC
ImageMagick release date 	2011-10-12
ImageMagick number of supported formats: 	197
ImageMagick supported formats 	3FR, A, AAI, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FITS, FRACTAL, FTS, G, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, JNG, JPEG, JPG, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MAT, MATTE, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive	Local Value	Master Value
imagick.locale_fix	0	0
imagick.progress_monitor	0	0
Last edited 23 months ago by SergeyBiryukov (previous) (diff)

comment:3 @nacin23 months ago

My initial questions would be:

  • Which host is this?
  • What exactly does phpinfo() reveal about tmp directories? upload_tmp_dir? TMPDIR? Other environment variables?
  • Why does Imagick work but GD does not?
  • Is there a way to specify the temporary location used by Imagick?
  • Without WP_TEMP_DIR, what does get_temp_dir()? If things aren't writable, at the very least wp-content should be, and that's what we use before falling back to /tmp/.

comment:4 @markoheijnen23 months ago

To me adding a define is a wontfix. There is a filter so we should use that one.

As nacin I'm also curious in this setup and see if we can fix something in core to make it more stable.

comment:5 @fierevere23 months ago

Which host is this? -> jino.ru

upload_tmp_dir -> defined, working

environment variables -> they have only LANG and PATH, nothing else, not even HOSTNAME, HOME or USER

Why does Imagick work but GD does not? -> Imagick does NOT, GD works (unless not attempting to create tempfile)

I am not sure if /tmp is writeable on that server, they dont allow unrestricted ssh access and CPanel and FTP is limited to user's home. Theme and plugin installer wasnt working without define( 'WP_TEMP_DIR', ABSPATH . '/tmp/') ;

PS: they use mod_pizza (closed, proprietary) access controller for apache , it seem to restrict access to upper level folders than user's home

Last edited 23 months ago by fierevere (previous) (diff)

comment:6 @fierevere22 months ago

  • Resolution set to wontfix
  • Status changed from new to closed

Сергей, спасибо за решение с фильтрами, к сожалению в свете последних несправедливых событий, я не считаю то что какая-либо помощь сообществу принесет что-либо кроме черной неблагодарности, а посему деталей о Джино не будет.

Т.к. патч не примут - тикет закрываю.

comment:7 @markoheijnen19 months ago

  • Milestone Awaiting Review deleted

Clearing out the milestones for closed tickets on Awaiting Review

Note: See TracTickets for help on using tickets.