PHPackages                             bnomei/kirby3-cloudconvert - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bnomei/kirby3-cloudconvert

AbandonedArchivedKirby-plugin[Utility &amp; Helpers](/categories/utility)

bnomei/kirby3-cloudconvert
==========================

Plugin to convert anything to anything using cloudconvert.

1.1.10(3y ago)865[3 issues](https://github.com/bnomei/kirby3-cloudconvert/issues)[1 PRs](https://github.com/bnomei/kirby3-cloudconvert/pulls)MITPHPPHP &gt;=8.0

Since Oct 23Pushed 1y agoCompare

[ Source](https://github.com/bnomei/kirby3-cloudconvert)[ Packagist](https://packagist.org/packages/bnomei/kirby3-cloudconvert)[ RSS](/packages/bnomei-kirby3-cloudconvert/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (5)Versions (16)Used By (0)

Kirby Cloudconvert
==================

[](#kirby-cloudconvert)

[![Release](https://camo.githubusercontent.com/10f3cee768508db33a011e2fa1b6cb06492706a92c460172c8de84cd568197c0/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d636c6f7564636f6e766572743f636f6c6f723d616538316666)](https://camo.githubusercontent.com/10f3cee768508db33a011e2fa1b6cb06492706a92c460172c8de84cd568197c0/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f626e6f6d65692f6b69726279332d636c6f7564636f6e766572743f636f6c6f723d616538316666)[![Downloads](https://camo.githubusercontent.com/cf9c387da8d0f047758ac647412d7efe68db9ff1da4f4c19681af5e7d8aef513/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f626e6f6d65692f6b69726279332d636c6f7564636f6e766572743f636f6c6f723d323732383232)](https://camo.githubusercontent.com/cf9c387da8d0f047758ac647412d7efe68db9ff1da4f4c19681af5e7d8aef513/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f626e6f6d65692f6b69726279332d636c6f7564636f6e766572743f636f6c6f723d323732383232)[![Build Status](https://camo.githubusercontent.com/17e9ef1e5e2a8c60080b8aa533863905a5aae3b79caf7dd5f9a40822b6291239/68747470733a2f2f666c61742e62616467656e2e6e65742f7472617669732f626e6f6d65692f6b69726279332d636c6f7564636f6e76657274)](https://travis-ci.com/bnomei/kirby3-cloudconvert)[![Coverage Status](https://camo.githubusercontent.com/a5723744090e3fdee6a01571ba7938d67314cf2b928c0f372bd27c2456a92130/68747470733a2f2f666c61742e62616467656e2e6e65742f636f766572616c6c732f632f6769746875622f626e6f6d65692f6b69726279332d636c6f7564636f6e76657274)](https://coveralls.io/github/bnomei/kirby3-cloudconvert)[![Maintainability](https://camo.githubusercontent.com/8092d8f001d4ce3147c4f89d8cc7ba6d42b23b7189535a277c7e0c31bcfd9162/68747470733a2f2f666c61742e62616467656e2e6e65742f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f626e6f6d65692f6b69726279332d636c6f7564636f6e76657274)](https://codeclimate.com/github/bnomei/kirby3-cloudconvert)[![Twitter](https://camo.githubusercontent.com/b90e4b58a887e8ad09ec267628b75199a48522a9e01e88b129e5d2d730dffe50/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f747769747465722f626e6f6d65693f636f6c6f723d363664396566)](https://twitter.com/bnomei)

Plugin to convert anything to anything using [cloudconvert](https://cloudconvert.com/).

Installation
------------

[](#installation)

- unzip [master.zip](https://github.com/bnomei/kirby3-cloudconvert/archive/master.zip) as folder `site/plugins/kirby3-cloudconvert` or
- `git submodule add https://github.com/bnomei/kirby3-cloudconvert.git site/plugins/kirby3-cloudconvert` or
- `composer require bnomei/kirby3-cloudconvert`

How to convert files on demand (synchronously)?
-----------------------------------------------

[](#how-to-convert-files-on-demand-synchronously)

### Example 1: docx to pdf

[](#example-1-docx-to-pdf)

```
if($fileWord = $page->file('test.docx')) {
    $filePDF = $fileWord->cloudconvert(
        [
            'inputformat' => 'docx',
            'outputformat' => 'pdf',
        ],
        str_replace('.docx', '.pdf', $fileWord->root()),
        false // wait for conversion to be done
    );
    echo $fileWord->url().PHP_EOL;
    if($filePDF) {
        echo $filePDF->url();
    }
}
```

Hooks: How to convert files on upload/replace (asynchronously by default)?
--------------------------------------------------------------------------

[](#hooks-how-to-convert-files-on-uploadreplace-asynchronously-by-default)

### Example 2: gif to webm and mp4

[](#example-2-gif-to-webm-and-mp4)

In Kirbys config file add this... then use panel to upload a gif to an image/file section.

```
function customConvertHook($file) {
    if($file->extension() == 'gif') {

        $file->cloudconvert(
            [
                'inputformat' => 'gif',
                'outputformat' => 'webm',
                'save' => true, // keep file at cloud to avoid another download from cloudconvert-server
            ]
        );

        $file->cloudconvert(
            [
                'inputformat' => 'gif',
                'outputformat' => 'mp4',
            ]
        );
    }
}

return [
    // ... other config settings
    'hooks' => [
        'file.create:after' => function($file) {
            customConvertHook($file);
        },
        'file.replace:after' => function($newFile, $oldFile) {
            customConvertHook($newFile);
        },
    ]
];
```

Other Usecases
--------------

[](#other-usecases)

### Example 3: convert ai to svg and optimize

[](#example-3-convert-ai-to-svg-and-optimize)

This example shows how to use this plugin with my [thumb imageoptim plugin](https://github.com/bnomei/kirby3-thumb-imageoptim).

```
$fileSvg = $file->cloudconvert(
    [
        'inputformat' => 'ai',
        'outputformat' => 'svg',
    ],
    null, // auto-rename with extension
    false // on-demand aka synchonous aka wait
);
if($fileSvg) {
    // NOTE: resize() is called to trigger stuff like optimziers (see thumb-imageoptim plugin)
    $fileSvgOptimized = $fileSvg->resize();
    echo svg($fileSvgOptimized->root()); // use kirbys svg helper to inline the svg
}
```

### Example 4: How to convert image files for srcsets? jpg to webp.

[](#example-4-how-to-convert-image-files-for-srcsets-jpg-to-webp)

This example shows how to use this plugin with my [srcset plugin](https://github.com/bnomei/kirby3-srcset).

**config file**

```
return [
    // ... other settings
    'bnomei.srcset.types' => ['jpg', 'webp'],
    'bnomei.srcset.resize' => function (\Kirby\Cms\File $file, int $width, string $type) {
        // NOTE: resize() is called to trigger stuff like optimziers (see thumb-imageoptim plugin)

        // use jpg to create webp
        if($file->extension() == 'jpg' && $type == 'webp') {
            $fileWebp = $file->cloudconvert(
                [
                    'inputformat' => 'jpg',
                    'outputformat' => 'webp',
                ],
                null, // auto-rename with extension
                false // on-demand aka synchonous aka wait
            );
            if($fileWebp) {
                return $fileWebp->resize($width);
            }
        }
        // otherwise default to returning image
        return $file->resize($width);
    }
];
```

Global cloudconvert helper function
-----------------------------------

[](#global-cloudconvert-helper-function)

This plugin provides a helper function to call the cloudconvert api.

```
$obj = cloudconvert($options); // will change extension but keep path
$obj = cloudconvert($options, $outputPath); // provide different path
$obj = cloudconvert($options, $outputPath, $async); // a/sync
```

**Retrun Values**

- `Kirby\Cms\File` if `$options['file']` is one as well and `$async == false`
- otherwise it returns an instance of `CloudConvert\Process`
- or `null` on error

Performance
-----------

[](#performance)

**TD;DR**Calling File-Method has best performance since it only converts the file if it was modified or is new.

### File-Object

[](#file-object)

Using `Kirby\Cms\File` object for `$options['file']` is recommended. In that case the modified timestamp will be checked against a cached value and a conversion triggered only if a file was modified or output does not exist. This is the default behaviour for the FileMethod provided by this plugin.

> DANGER: There is no check (yet) if a file is currently processed by cloudconvert. This might be improved at a later point.

### Path

[](#path)

When a path is used then file will be created only if ouput does not exist. You need to do modification checks and removing of old files yourself before starting the conversion.

Settings
--------

[](#settings)

bnomei.cloudconvert.DefaultDescriptionapikey`null`your cloudconvert apikey as stringconvert`callback`asynchronous or synchronous conversion depending on params.async`true`options`['input' => 'download']`By default this plugin requires the file to be public otherwise use `upload` here. On localhost `upload` is used as a default.log.enabled`false`log`callback`to `kirbyLog()`> TIP: you can also set a callback if you use the [dotenv Plugin](https://github.com/bnomei/kirby3-dotenv)`'bnomei.cloudconvert.apikey' => function() { return env('CLOUDCONVERT_APIKEY'); },`

> TIP: consider setting up [presets](https://cloudconvert.com/presets) to manage your settings from within the cloudconvert dashboard instead of the Kirby config file.

Disclaimer
----------

[](#disclaimer)

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please [create a new issue](https://github.com/bnomei/kirby3-cloudconvert/issues/new).

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~115 days

Recently: every ~220 days

Total

14

Last Release

1253d ago

PHP version history (3 changes)1.0.1PHP &gt;=7.1.0

1.1.5PHP &gt;=7.2.0

1.1.10PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3265642?v=4)[Bruno Meilick](/maintainers/bnomei)[@bnomei](https://github.com/bnomei)

---

Top Contributors

[![bnomei](https://avatars.githubusercontent.com/u/3265642?v=4)](https://github.com/bnomei "bnomei (32 commits)")

---

Tags

anythingcloudconvertconvertconvert-imageskirby3kirby3-cmskirby3-pluginconvertkirby3kirby3-pluginkirby3-cmscloudconvertanythingconvert-images

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bnomei-kirby3-cloudconvert/health.svg)

```
[![Health](https://phpackages.com/badges/bnomei-kirby3-cloudconvert/health.svg)](https://phpackages.com/packages/bnomei-kirby3-cloudconvert)
```

###  Alternatives

[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[bvdputte/kirby-fingerprint

Cache-busting utility to fingerprint assets (JS/CSS) in Kirby 3

1610.0k](/packages/bvdputte-kirby-fingerprint)[schnti/cachebuster

A plugin for Kirby 3 CMS to add modification timestamps to css and js files

108.3k1](/packages/schnti-cachebuster)[bnomei/kirby3-php-cachedriver

PHP based Cache-Driver

112.6k](/packages/bnomei-kirby3-php-cachedriver)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
