How to reduce the image size without losing quality in PHP [closed]

If you are looking to reduce the size using coding itself, you can follow this code in php. <?php function compress($source, $destination, $quality) { $info = getimagesize($source); if ($info[‘mime’] == ‘image/jpeg’) $image = imagecreatefromjpeg($source); elseif ($info[‘mime’] == ‘image/gif’) $image = imagecreatefromgif($source); elseif ($info[‘mime’] == ‘image/png’) $image = imagecreatefrompng($source); imagejpeg($image, $destination, $quality); return $destination; } $source_img … Read more

CSS delivery optimization: How to defer css loading?

If you don’t mind using jQuery, here is a simple code snippet to help you out. (Otherwise comment and I’ll write a pure-js example function loadStyleSheet(src) { if (document.createStyleSheet){ document.createStyleSheet(src); } else { $(“head”).append($(“<link rel=”stylesheet” href=””+src+” />”)); } }; Just call this in your $(document).ready() or window.onload function and you”re good to go. For #2, … Read more

What is “above-the-fold content” in Google Pagespeed?

This is because Google recently changed the page speed tool to better reflect an increasingly mobile web. Mobile data networks have different performance characteristics than wired or wifi so you need to do different things to optimize for them. Above-the-fold (ATF) is simply the first screen’s worth–anything you don’t need to scroll to see. Obviously, … Read more

How does Google’s Page Speed lossless image compression work?

If you’re really interested in the technical details, check out the source code: png_optimizer.cc jpeg_optimizer.cc webp_optimizer.cc For PNG files, they use OptiPNG with some trial-and-error approach // we use these four combinations because different images seem to benefit from // different parameters and this combination of 4 seems to work best for a large // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)