    static public function compress_png($path, $max_quality = 85) {

        $check = shell_exec("pngquant --version");
        if(!$check) {
            return false;
        }else{
            // guarantee that quality won't be worse than that.
            $min_quality = 60;

            // '-' makes it use stdout, required to save to $compressed_png_content variable
            // '<' makes it read from the given file path
            // escapeshellarg() makes this safe to use with any path
            $compressed_png_content = shell_exec("pngquant --quality=$min_quality-$max_quality - < ".escapeshellarg($path));

            if (!$compressed_png_content) {
                throw new Exception("Conversion to compressed PNG failed. Is pngquant 1.8+ installed on the server?");
            }else{
                file_put_contents($path, $compressed_png_content);
                return true;
            }

            
        }
    }

The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.