further reduce image sizes
-
Hi – some images may have a margin or padding. To take this into the calculation i experimented with adaptive-images-front.php:
<!--noptimize--> <script type = "text/javascript"> // // Get screen dimensions, device pixel ration and set in a cookie. // <?php if ( $options['landscape'] ) : ?> var screen_width = Math.max( screen.width, screen.height ); <?php else : ?> var padding = 20*2; var screen_width = screen.width-padding;//subtract padding <?php endif; ?> var devicePixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1; document.cookie = 'resolution=' + screen_width + ',' + devicePixelRatio + '; SameSite=Strict; path=/'; </script> <!--/noptimize-->
I tested a little on chrome. It works for some resolutions. For apple devices i receive inaccurate results. But anyway, this may help to reduce the image size a little more.
regards – theo
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘further reduce image sizes’ is closed to new replies.