| @@ -66,9 +66,20 @@ | ||
| 66 | 66 | * @since 1.9.8 |
| 67 | 67 | * @since WP 5.3 |
| 68 | 68 | * @author Grégory Viguier |
| 69 | 69 | */ |
| 70 | -add_filter( 'big_image_size_threshold', [ imagify_get_context( 'wp' ), 'get_resizing_threshold' ], IMAGIFY_INT_MAX ); | |
| 70 | +add_filter( 'big_image_size_threshold', [ imagify_get_context( 'wp' ), 'filter_big_image_size_threshold' ], IMAGIFY_INT_MAX ); | |
| 71 | + | |
| 72 | +/** | |
| 73 | + * Note the uploads WordPress 7.1 hands to the browser, which scales them itself. | |
| 74 | + * | |
| 75 | + * Fires before the attachment metadata is generated, so the threshold filter above already | |
| 76 | + * knows about it by the time it runs. | |
| 77 | + * | |
| 78 | + * @since 2.3.3 | |
| 79 | + * @since WP 7.1 | |
| 80 | + */ | |
| 81 | +add_action( 'rest_after_insert_attachment', [ imagify_get_context( 'wp' ), 'maybe_flag_client_side_scaling' ], 10, 3 ); | |
| 71 | 82 | |
| 72 | 83 | /** |
| 73 | 84 | * Add filters to manage images formats that will be generated |
| 74 | 85 | * |