# ImageMagick thumb driver implementation using Imagick API

**URL:** <https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967>\
**Category:** Solutions\
**Tags:** v2\
**Created:** [April 27, 2019, 11:30pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967 "2019-04-27T23:30:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmedveckyh](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jmedveckyh](https://forum.getkirby.com/u/jmedveckyh)\
**Post date:** [April 27, 2019, 11:30pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/1 "2019-04-27T23:30:09Z")

</div>

I needed to use ImageMagick as my thumb driver because I wanted to create GIF thumbnails automatically and GDlib doesn’t support that.

Then I found out my web hosting provider doesn’t support executing shell commands from user scripts, probably for security reasons, but unfortunately that’s exactly how Kirby uses ImageMagick.

However, the hosting provider does support calls to the Imagick API so I rewrote the commands to the API calls.

[https://gist.github.com/jmedveckyh/4e2441b898e7be1aa664e890bcc19274](https://gist.github.com/jmedveckyh/4e2441b898e7be1aa664e890bcc19274)

Feel free to use this code (just place the script in your site/plugins folder and enable it in config.php).  
Maybe this will help someone in a similar situation 🙂

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 27, 2019, 11:53pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/2 "2019-04-27T23:53:42Z")

</div>

You can create your own driver, no need to modify the source code.

[http://k2.getkirby.com/docs/developer-guide/toolkit/thumb-driver](http://k2.getkirby.com/docs/developer-guide/toolkit/thumb-driver)

---

<div class="post-metadata">

**Author:** ![jmedveckyh](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jmedveckyh](https://forum.getkirby.com/u/jmedveckyh)\
**Post date:** [April 28, 2019, 1:34am UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/3 "2019-04-28T01:34:13Z")

</div>

thats cool! edited the original post

---

<div class="post-metadata">

**Author:** ![myrin](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@myrin](https://forum.getkirby.com/u/myrin)\
**Post date:** [August 28, 2023, 1:55pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/4 "2023-08-28T13:55:52Z")

</div>

Hi @jmedveckyh

Sorry for reviving this 4 years old conversation, but I’m running into the same problem!

I get a 404 when I click the link for your code. Do you still have this code available somewhere? (or maybe a kirby 3 version? 🙏🏻😅)

Thanks!

---

<div class="post-metadata">

**Author:** ![jmedveckyh](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@jmedveckyh](https://forum.getkirby.com/u/jmedveckyh)\
**Post date:** [September 23, 2023, 5:31pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/5 "2023-09-23T17:31:02Z")

</div>

Hey,

no problem - i found the gist is still up but i renamed my github profile, so the new link is

> <https://gist.github.com/jmheretik/4e2441b898e7be1aa664e890bcc19274>

---

<div class="post-metadata">

**Author:** ![myrin](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@myrin](https://forum.getkirby.com/u/myrin)\
**Post date:** [September 25, 2023, 10:22am UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/6 "2023-09-25T10:22:08Z")

</div>

Hi,

Thanks! This is helpful.

If I manage to make a Kirby 3 (or Kirby 4) version, I’ll post it here.

---

<div class="post-metadata">

**Author:** ![jrkb](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jrkb](https://forum.getkirby.com/u/jrkb)\
**Post date:** [August 9, 2024, 11:49am UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/7 "2024-08-09T11:49:18Z")

</div>

Hey @texnixe ,

Is there an updated guide for kirby 4?  
I’d love to avoid changing the kirby source code 🙂

Thanks!

(I’m aware this post is super old, but I assume most people with this issue will still land here)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [August 9, 2024, 12:05pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/8 "2024-08-09T12:05:54Z")

</div>

Not sure what guide you mean? Maybe check out [Vips thumbnail | Kirby CMS Plugins](https://plugins.getkirby.com/floriankarsten/vipsthumbnail) for an example thumb driver replacement.

---

<div class="post-metadata">

**Author:** ![jrkb](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@jrkb](https://forum.getkirby.com/u/jrkb)\
**Post date:** [August 9, 2024, 1:17pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/9 "2024-08-09T13:17:51Z")

</div>

Thanks, this helps!

I meant the old guide you posted in 2019. I thought it would be automatically attached as a quote when I hit “reply”, don’t expect you to remember it of course 🤯 I meant this one:

> [@ImageMagick thumb driver implementation using Imagick API](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/2):
>
> You can create your own driver, no need to modify the source code. [http://k2.getkirby.com/docs/developer-guide/toolkit/thumb-driver](http://k2.getkirby.com/docs/developer-guide/toolkit/thumb-driver)

I was just curious if one exists for kirby 4, but I can also figure it out by checking the example. All good, thanks again.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:22pm UTC](https://forum.getkirby.com/t/imagemagick-thumb-driver-implementation-using-imagick-api/13967/10 "2025-02-06T17:22:52Z")

</div>

Archived on February 6, 2025, 5:22pm UTC


