Giter VIP home page Giter VIP logo

modern-images-wp's Introduction

Modern Images for WordPress

Specify the default image format used for sub-sized images generated by WordPress.

Technical Notes

Screenshots

  1. Modern image output format options on Settings > Media admin page.

image

  1. Image format options available for various image types.

image

modern-images-wp's People

Contributors

adamsilverstein avatar alexclassroom avatar jeffpaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

modern-images-wp's Issues

Fatal Error with plugin -

Hi!

Would love for this too work, please see below.

can't select an option in the dropdown either see image

WordPress version 5.8
Current plugin: Modern Images WP (version 1.0.1)
PHP version 7.4.21

Screen Shot 2021-07-28 at 17 53 20

Error

An error of type E_ERROR was caused in line 195 of the file /var/www/vhosts/web.co.uk/web.co.uk/wp-content/plugins/modern-images-wp-main/src/Setting.php. Error message: Uncaught Error: Call to undefined function Modern_Images_WP\str_to_upper() in /var/www/vhosts/web.co.uk/web.co.uk/wp-content/plugins/modern-images-wp-main/src/Setting.php:195 Stack trace: #0 /var/www/vhosts/web.co.uk/web.co.uk/wp-content/plugins/modern-images-wp-main/src/Setting.php(117): Modern_Images_WP\Setting->isImageFormatSupported() #1 /var/www/vhosts/web.co.uk/web.co.uk/wp-admin/includes/template.php(1743): Modern_Images_WP\Setting->Modern_Images_WP\{closure}() #2 /var/www/vhosts/web.co.uk/web.co.uk/wp-admin/includes/template.php(1701): do_settings_fields() #3 /var/www/vhosts/web.co.uk/web.co.uk/wp-admin/options-media.php(156): do_settings_sections() #4 {main} thrown

AVIF option in the dropdown is unselectable.

Sorry for disturbing.
I've already checked the former issue but couldn't figure out.

wp-media

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1691
imagemagick_version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
imagick_version: 3.6.0
file_uploads: File uploads is turned off
post_max_size: 4G
upload_max_filesize: 4G
max_effective_size: 4 GB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 122 MB
imagick::RESOURCETYPE_DISK: 1073741824
imagick::RESOURCETYPE_FILE: 768
imagick::RESOURCETYPE_MAP: 512 MB
imagick::RESOURCETYPE_MEMORY: 256 MB
imagick::RESOURCETYPE_THREAD: 1
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, 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, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMV, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: 9.53.3

1

Problems with enabling plug-ins

Error type E_ Error occurs in the file /www/wwwroot/xinhuoyikao.com/wp-content/plugins/modern-images-wp/src/Setting.php的195行。错误信息:Uncaught Error: Call to undefined function Modern_Images_WP\str_to_upper() in /www/wwwroot/xinhuoyikao.com/wp-content/plugins/modern-images-wp/src/Setting.php:195
Stack trace:
#0 /www/wwwroot/xinhuoyikao.com/wp-content/plugins/modern-images-wp/src/Setting.php(117): Modern_Images_WP\Setting->isImageFormatSupported()
#1 /www/wwwroot/xinhuoyikao.com/wp-admin/includes/template.php(1743): Modern_Images_WP\Setting->Modern_Images_WP{closure}()
#2 /www/wwwroot/xinhuoyikao.com/wp-admin/includes/template.php(1701): do_settings_fields()
#3 /www/wwwroot/xinhuoyikao.com/wp-admin/options-media.php(156): do_settings_sections()
#4 {main}
thrown

Fata error when enabling plugin

Wordpress detected a fatal error when I enabled the plugin and went to the settings.

WordPress version 5.8
Current plugin: Modern Images WP (version 1.0.1)
PHP version 7.4.21

Error Details
=============
An error of type E_ERROR was caused in line 195 of the file /wp-content/plugins/modern-images-wp/src/Setting.php. Error message: Uncaught Error: Call to undefined function Modern_Images_WP\str_to_upper() in /wp-content/plugins/modern-images-wp/src/Setting.php:195
Stack trace:
#0 /wp-content/plugins/modern-images-wp/src/Setting.php(117): Modern_Images_WP\Setting->isImageFormatSupported()
#1 /wp-admin/includes/template.php(1743): Modern_Images_WP\Setting->Modern_Images_WP\{closure}()
#2 /wp-admin/includes/template.php(1701): do_settings_fields()
#3 /wp-admin/options-media.php(156): do_settings_sections()
#4 {main}
 thrown

Installed and activated, error in Media Settings drop-down

On /wp-admin/options-media.php when trying to choose an image format for JPGs, it shows the drop-down as:

  • Use original format (default)
  • There has been a critical error on this website. ...

The email I received details the error:

Error Details

An error of type E_ERROR was caused in line 195 of the file /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/modern-images-wp-main/src/Setting.php. Error message: Uncaught Error: Call to undefined function Modern_Images_WP\str_to_upper() in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/modern-images-wp-main/src/Setting.php:195
Stack trace:
#0 /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/modern-images-wp-main/src/Setting.php(117): Modern_Images_WP\Setting->isImageFormatSupported()
#1 /var/www/vhosts/domain.com/httpdocs/wp-admin/includes/template.php(1743): Modern_Images_WP\Setting->Modern_Images_WP{closure}()
#2 /var/www/vhosts/domain.com/httpdocs/wp-admin/includes/template.php(1701): do_settings_fields()
#3 /var/www/vhosts/domain.com/httpdocs/wp-admin/options-media.php(156): do_settings_sections()
#4 {main}
thrown

LinkedIn does not support webp in article previews

https://www.linkedin.com/help/linkedin/answer/34327/media-file-types-supported-on-linkedin?lang=en

Sorry that this is a partial duplicate of the "convert to multiple formats" concern. I wanted to highlight the og:meta use case so I felt it was reasonable to create this as its own issue.

Obviously we can't fix LinkedIn, but it seems like we would benefit some sort of filter to make sure we can provide a jpeg version for og:meta, while converting to webp.

Can't select an option from the dropdowns

On the media settings page, I literally can't select an option in the dropdown other than the default which is already selected.

image

WP 5.8

Cleared all server and browser cache. Made no difference.

Enable <picture> element & convert to multiple formats

It would be nice if it was possible to convert to multiple formats and then use the <picture> element to make them all available.

This would remove the need to use a polyfill for WebP (it's not only IE, but Safari too - they only added support recently), AVIF, and other formats. Smaller website operators already have difficulties meeting Google PageSpeed requirements (Lighthouse 8.0 is even stricter), so more js files is not what they need.

It would also make it easier for WordPress to adopt newer formats. WebP was released ~10 years ago... will we have to wait another 10 years for AVIF? With <picture> we can have WebP and/or AVIF and a JPG/PNG/GIF fallback.

As for downsides, I can think of 3:

  • It uses more storage.
  • Upload can be slow if conversion happens right away.
  • It will use more CPU.

For the disk space, I don't think this is a huge issue as even shared hosting plans come with a lot of space these days.

Regarding upload speeds, processing could happen in the background for some formats. For example, if it's slow to convert to AVIF, WordPress could generate a WebP copy first and then convert AVIF later on. If a AVIF file is uploaded, then conversion could happen in real time. (Plugins like EWWW Image Optimizer support this and it's useful when we're uploading multiple files or are on slow servers.)

CPU usage... well, not sure if there's much that can be done here.

Maybe this shouldn't the default behaviour, but I think it would be useful if WordPress supported this.

Improve email compatibility for WebP images

Unfortunately, the webp image format is not well supported in some versions of Outlook:

https://www.caniemail.com/features/image-webp/

Although it's not a large % globally, I run a fairly run-of-the-mill platform for law firms, and for our audience the number is more like 15%.

In our case, our emails come from MailChimp scraping our RSS feeds, and so it would be nice to have a jpeg version available for use in RSS (assuming the blog author has uploaded a jpeg that we are converting to webp). And it would be nice if it were not the "full" image file, which can be way, way too large.

I'm not sure of the best way to go about this.

Any thoughts? Plans? Suggestions?

Possible conflict with customizer -> site icon

Hi, see screenshot where I'm getting a console error when I provide a png favicon in the customizer.

Uncaught TypeError: Cannot read properties of undefined (reading 'site_icon-32')

The end result is that it fails to apply the new icon, and also it seems to generate a weird blank image in the media library.

I'm not sure what to make of this, but it seems like a bit of a roadblock. If I remove the plugin, I can upload and pick my favicon just fine. And of course, if I config the plugin to no longer convert png's, it works fine as well.

If the image_editor_output_format exposed more information about the image and the current screen, I might be able to conditional my way out of this. As it is now, I'm not sure what a good workaround would be.

Screen Shot 2021-11-22 at 3 36 39 PM

Original images are sometimes directly used without compressing.

When the rendered size is close to the original image intrinsic size,the original image will be shown.
Which will SIGNIFICANTLY impact loading speed.
originalimage
originalimage2
originalimage3
I think generating a compressed image with the same size as the original image is a better idea.
Thanks.

avif and jpg XL greyed out

Hello,

First of all thanks for this plugin.
Do I need to install something special on my dedicated server, before I can select Avif from the dropdown menu?

Currently, its greyed out.

I am using wordpress 5.8-RC2-51407, How to use it

I am using wordpress 5.8-RC2-51407, Start the plug-in prompt error: the current WordPress version (5.8-RC2-51407) failed to meet the minimum version requirements of Modern Images WP. This plugin requires WordPress 5.8.

I am in wp-includes/version.php and changed $wp_version = '5.8-RC2-51407'; to $wp_version = '5.8'; starting the plug-in has no effect

New crops don’t working if i cut image in internal Wordpress editor (jpg to webp)

Hi! I’m using the web stories plugin, and if i set the sub-size crops to webp (with original image with jpg extension), for the poster image don’t have create correct crops. It’s show blank images.

https://imgur.com/a/WWWqoza

I was tried to create a thread in web-stories foruns, but they suggest to create here too.

https://wordpress.org/plugins/web-stories/

I'm using the most recent Wordpress and web stories version 1.17.

Thanks in Advanced and sorry for my bad english.

It didn't convert my jpeg

I enabled the option "Uploaded jpeg images will be output in this format. " to webp and uploaded a new .jpeg but the webp file doesn't exist... does it take a while? Would be great if it can also convert existing files...

Will it keep the original file?
What about if the browser doesn't support webp?

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.