<commit_before>## Image
[Back to the navigation](index.md)

Link: [Imgur Image API](https://api.imgur.com/endpoints/image).

#### Image Upload
```php
<?php
$imageData = array(
        'image' => $pathToFile,
        'type'  => 'file',
        'name' => 'Lipsum',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
##### OR


```php
<?php
$imageData = array(
        'image' => $urlToFile,
        'album' => $albumId,
        'type'  => 'url',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
##### OR


```php
<?php
$imageData = array(
        'image' => base64_encode(file_get_contents($pathToFile)),
        'album' => $albumId,
        'type'  => 'base64',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
#### Image

```php
<?php
$image = $client->api('image')->image($imageId);
```
    
#### Image Deletion

```php
<?php
$basic = $client->api('image')->deleteImage($imageIdOrDeleteHash);
```
    
#### Update Image Information

```php
<?php
$imageInfo = array(
    'title' => 'Lorem Ipsum',
    'description' => 'Lorem Ipsum Dolor Sit Amet'
);
$basic = $client->api('image')->update($imageIdOrDeleteHash, $imageInfo);
```
    
#### Favorite image

```php<commit_msg>added missing php tag for Image docs<commit_after>## Image
[Back to the navigation](index.md)

Link: [Imgur Image API](https://api.imgur.com/endpoints/image).

#### Image Upload
```php
<?php
$imageData = array(
        'image' => $pathToFile,
        'type'  => 'file',
        'name' => 'Lipsum',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
##### OR


```php
<?php
$imageData = array(
        'image' => $urlToFile,
        'album' => $albumId,
        'type'  => 'url',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
##### OR


```php
<?php
$imageData = array(
        'image' => base64_encode(file_get_contents($pathToFile)),
        'album' => $albumId,
        'type'  => 'base64',
        'title' => 'Lorem Ipsum',
        'description' => 'Lorem Ipsum Dolor Sit Amet'
    );

$basic = $client->api('image')->upload($imageData);
```
    
#### Image

```php
<?php
$image = $client->api('image')->image($imageId);
```
    
#### Image Deletion

```php
<?php
$basic = $client->api('image')->deleteImage($imageIdOrDeleteHash);
```
    
#### Update Image Information

```php
<?php
$imageInfo = array(
    'title' => 'Lorem Ipsum',
    'description' => 'Lorem Ipsum Dolor Sit Amet'
);
$basic = $client->api('image')->update($imageIdOrDeleteHash, $imageInfo);
```
    
#### Favorite image

```php
<?php
{'fraction_non_alphanumeric': 0.21942326814716606, 'fraction_numerical': 0.002651640702684786, 'mean_word_length': 3.15702479338843, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 61, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2298783', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1057, 'n_words': 226}