PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
← All changes | classes/Optimization/Process/WP.php +28 -0 2.3.2 → trunk View file →
@@ -17,8 +17,36 @@
17 17 */
18 18 class WP extends AbstractProcess {
19 19
20 20 /** ----------------------------------------------------------------------------------------- */
21 + /** RESIZING ================================================================================ */
22 + /** ----------------------------------------------------------------------------------------- */
23 +
24 + /**
25 + * Tell if a size should be resized.
26 + *
27 + * When the browser handled the upload it also produced the scaled version, using the
28 + * very threshold Imagify configured ({@see \Imagify\Context\WP::filter_big_image_size_threshold()}),
29 + * so resizing here would only shrink the untouched original that WordPress keeps
30 + * aside as `original_image`.
31 + *
32 + * @since 2.3.3
33 + *
34 + * @param string $size The size name.
35 + * @param File $file A File instance.
36 + * @return bool
37 + */
38 + protected function can_resize( $size, $file ) {
39 + $media = $this->get_media();
40 +
41 + if ( $media && \Imagify\Context\WP::is_client_side_scaled( $media->get_id() ) ) {
42 + return false;
43 + }
44 +
45 + return parent::can_resize( $size, $file );
46 + }
47 +
48 + /** ----------------------------------------------------------------------------------------- */
21 49 /** MISSING THUMBNAILS ====================================================================== */
22 50 /** ----------------------------------------------------------------------------------------- */
23 51
24 52 /**