How generate 200% image size and save with suffix @2x
How generate 200% image size and save with suffix @2x
How generate 200% image size and save with suffix @2x
The documentation for Retina JS states that images need to have the data-rjs attribute set in order for them to opt in to using the script. This can be done using the third parameter of get_the_post_thumbnail() : <?php echo get_the_post_thumbnail( get_the_ID(), ‘thumbnail’, array( ‘data-rjs’ => ‘3’ ) ); ?>
I would rather just set the width and let the height be automatically adjusted to the proportion, so I won’t even have to crop the images. If the images are not all the same proportion then some cropping will have to be done. If you want to avoid cropping then you’ll need to make sure … Read more
1) A workaround by extending the WP_Image_Editor_GD class The problem is how to access the image sizes before we change the quality of intermediate jpeg images. Note that the image_resize() function is deprecated. We can use the jpeg_quality filter from the public get_quality method of the abstract WP_Image_Editor class: $quality = apply_filters( ‘jpeg_quality’, $quality, ‘image_resize’ … Read more