Giter VIP home page Giter VIP logo

Comments (21)

adamsilverstein avatar adamsilverstein commented on August 15, 2024 1

Thanks @quadcom - I see what is happening here now - by default WordPress will use the first available image editor in its list, with Imagick being before GD in the default list. I also see now that I can pass a mime type to _wp_image_editor_choose that will change the behavior to choose the first editor that supports the mime type in question.

I will push an update that should fix the dropdown for you.

from modern-images-wp.

guugg avatar guugg commented on August 15, 2024

It seems that the plug-in cannot be used yet, I can use it locally, but it wonโ€™t work when I install it online

from modern-images-wp.

paroj avatar paroj commented on August 15, 2024

the issue is this code:

$image_editor = _wp_image_editor_choose();
$image_info = array(
'gd_info' => extension_loaded( 'gd' ) ? gd_info() : array(),
'imagick_info' => extension_loaded( 'imagick' ) ? \Imagick::queryFormats() : array(),
);
if ( $image_editor === 'WP_Image_Editor_Imagick' && ! empty( $image_info['imagick_info'] ) ) {
return in_array( str_to_upper( $format ), $image_info['imagick_info'] );
}

If you got both imagick and libgd, but your imagick does not yet support webp, while libgd would it erroneously returns false

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

My server actually doesn't have Imagemagick installed at all. GD is installed and does support WebP according to WP Health Info.

from modern-images-wp.

devilcheng avatar devilcheng commented on August 15, 2024

I can't choose AVIF and JPEG XL.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

I can't choose AVIF and JPEG XL.

Are those formats supported by your server? Check Site Health/Info to check.

If you got both imagick and libgd, but your imagick does not yet support webp, while libgd would it erroneously returns false

@quadcom - The code checks which image engine your server uses: $image_editor = _wp_image_editor_choose(); then checks if that image engine supports each format. Does this not work correctly for you? Can you paste the image support info from Site Health here please so I can see what your server setup looks like?

It seems that the plug-in cannot be used yet, I can use it locally, but it wonโ€™t work when I install it online

@guugg - can you give it another try please? something was broken in a previous release.

from modern-images-wp.

paroj avatar paroj commented on August 15, 2024

for me its:

key value
ImageMagick supported file formats 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
GD version bundled (2.1.0 compatible)
GD supported file formats GIF, JPEG, PNG, WebP, BMP, XPM

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

image

Can't select anything in the dropdown
image

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@paroj - thanks for the details, appears to be the same issue from my previous comment. I will work on the fix and let you know when you can test.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@paroj & @quadcom I improved support in #22 by passing the mime type when getting the image editor to use when checking support for each potential type.

Can you give that PR a test to see if you can now correctly select the WebP format from the dropdown?

ps. @quadcom I didn't see "ImageMagick supported file formats" in your screenshot, are you on WordPress 5.8? I wonder why that isn't showing.

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

"ps. @quadcom I didn't see "ImageMagick supported file formats" in your screenshot, are you on WordPress 5.8? I wonder why that isn't showing."

I don't think it's installed/enabled by default by Runcloud

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

I DL'd the zip from here and reinstalled. Showing the same version (1.0.2) and still shows the same behaviour.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@quadcom apologies for the confusion, you would have to check out the PR to test. Here is a zip file that should work, you should see the version change to 1.0.3 when installing.

modern-images-wp.zip

I don't think it's installed/enabled by default by Runcloud

Its odd though because your screenshot does show Imagick installed, just not it's supported file types:

image

Possibly something is wrong with how we are displaying these values in core.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@paroj & @quadcom I would appreciate your feedback here - I'd like to merge this soon and push a new release, please let me know if you see any issues and especially if this resolves the drop down not working for you.

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

Sorry for the delay. I'm sorry to say that this is still not working in my case.

from modern-images-wp.

paroj avatar paroj commented on August 15, 2024

using the zip referenced here, I can select WebP in the dropdown
#13 (comment)

However, no images seem to be actually converted. I examined existing images as well as uploading new ones. This should probably be tracked in a separate issue though.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@paroj Thanks for confirming this fixed the dropdown for you. Yes, let's address the images not being converted directly separately. One quick question - can you confirm you are able to upload WebP images in WordPress and it will correctly create sub sized WebP images for you?

I'm guessing (and need to investigate) that the logic that switches sub sizes to WebP happens too late or is not recognized by the logic that decides which image editor to use when resizing a particular image. Can you test again with this filter (or download the gist zip and install as a mini plugin) - https://gist.github.com/adamsilverstein/c8b5d0145aeda7fe0a04e4573f2c7c32 - in this case we may need a small change in core to address.

@quadcom ugh, I was hoping that would fix your case. Can you try the mini plugin above as well, that will set WordPress to prefer LibGD over Imagick which might help since you have both and I'm not sure your Imagick supports WebP. Also, can you confirm you see the plugin at 1.0.3 and are on WordPress 5.8?

from modern-images-wp.

quadcom avatar quadcom commented on August 15, 2024

Hey Adam, I just wanted to let you know that I rebuilt my galleries on my site using my builder. I was using a third-party gallery plugin as the built-in galleries Oxygen builder has, has been a nightmare. Once I removed Foogallery from the site, your plugin started working again.

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

@paroj - I have created a proposed core patch that adds the image format adjustment to the place where the image engine is determined, if possible, please give this a try: https://github.com/WordPress/wordpress-develop/pull/1918/files

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

Should be fixed by https://core.trac.wordpress.org/ticket/54476

from modern-images-wp.

adamsilverstein avatar adamsilverstein commented on August 15, 2024

๐Ÿ‘‹๐Ÿผ Hey @paroj & @quadcom we are working on a fix for this issue in https://core.trac.wordpress.org/ticket/54476 - would appreciate your help testing this if you are available - it only happens on certain environments (including yours), so verifying it fixes the issue for you would be helpful.

from modern-images-wp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.