<commit_before>#PHP-TinyPNG

A quick and easy to use library for interacting with the TinyPNG API.

To retrieve an API key please click [here](https://tinypng.com/developers)

For more information about TinyPNG or the TinyPNG API Documentation, please visit the links below:

[Official TinyPNG Website](https://tinypng.com/) - 
[TinyPNG API Documentation](https://tinypng.com/developers/reference)

## Contents

- [Usage](#usage)
- [Example Usage](#example-usage)
- [Example Responses](#example-responses)
- [Troubleshooting](#troubleshooting)
- [Issues / Pull Requests](#issues-pull-requests)

## Usage

1. Download the required files (listed below)
  - tinypng.php
  - cacert.pem (optional) - *This file is only required if you are having trouble connecting to the API's endpoint.*
2. Ensure that both files are within the same directory
3. Require tinypng.php
4. Create a new instance of TinyPNG, making sure that you input your API key as the first parameter
5. Finally, using the instance of TinyPNG that you just created, call the `compress` function to compress either a single or multiple images

## Example Usage

    <?php
    // Require tinypng.php
    require_once("path/to/tinypng.php");
    
    // Create a new instance of TinyPNG
    $tinypng = new TinyPNG("API_KEY_GOES_HERE");
    
    // Compress a single image
    $singleImage = $tinypng -> compress("input.png", "output.png");

    // Compress multiple images
    $images = array(
      "input.png"   => "output.png",
      "input-2.png" => "output.png"
    );
    $multipleImages = $tinypng -> compress($images);<commit_msg>Correct link in readme contents<commit_after>#PHP-TinyPNG

A quick and easy to use library for interacting with the TinyPNG API.

To retrieve an API key please click [here](https://tinypng.com/developers)

For more information about TinyPNG or the TinyPNG API Documentation, please visit the links below:

[Official TinyPNG Website](https://tinypng.com/) - 
[TinyPNG API Documentation](https://tinypng.com/developers/reference)

## Contents

- [Usage](#usage)
- [Example Usage](#example-usage)
- [Example Responses](#example-responses)
- [Troubleshooting](#troubleshooting)
- [Issues / Pull Requests](#issues--pull-requests)

## Usage

1. Download the required files (listed below)
  - tinypng.php
  - cacert.pem (optional) - *This file is only required if you are having trouble connecting to the API's endpoint.*
2. Ensure that both files are within the same directory
3. Require tinypng.php
4. Create a new instance of TinyPNG, making sure that you input your API key as the first parameter
5. Finally, using the instance of TinyPNG that you just created, call the `compress` function to compress either a single or multiple images

## Example Usage

    <?php
    // Require tinypng.php
    require_once("path/to/tinypng.php");
    
    // Create a new instance of TinyPNG
    $tinypng = new TinyPNG("API_KEY_GOES_HERE");
    
    // Compress a single image
    $singleImage = $tinypng -> compress("input.png", "output.png");

    // Compress multiple images
    $images = array(
      "input.png"   => "output.png",
      "input-2.png" => "output.png"
    );
    $multipleImages = $tinypng -> compress($images);
{'fraction_non_alphanumeric': 0.1092436974789916, 'fraction_numerical': 0.003734827264239029, 'mean_word_length': 3.726470588235294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3643791', 'n_tokens_mistral': 1033, 'n_tokens_neox': 967, 'n_words': 341}