# Custom CropRatio and cover: true for the image settings in a section generates an error

**URL:** <https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615>\
**Category:** Questions\
**Tags:** v5\
**Created:** [September 18, 2026, 3:40pm UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615 "2026-09-18T15:40:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paubou](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/paubou/32/10761_2.png) [@paubou](https://forum.getkirby.com/u/paubou)\
**Post date:** [September 18, 2026, 3:40pm UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615/1 "2026-09-18T15:40:25Z")

</div>

Hello.  
Using ratio with a custom value and the cover argument seems to cause a bug :

```yaml
sections:
  files:
    type: files
    label: Fichiers
    template: image
    layout: cards
    text: "{{file.firstname}}"
    info: "{{ file.caption }}"
    sortBy: firstname asc
    image:
      ratio: "{{file.cropRatio}}"
      cover: true

```

**« files » section could not be loaded:** Undefined array key 1

```auto
----

Cropratio: 8/10

----

```

Is this a known bug? Or am I missing something here?  
Thanks.

---

<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:** [September 19, 2026, 11:24am UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615/2 "2026-09-19T11:24:13Z")

</div>

I haven’t tried it out myself yet, but I saw you have the `image` option twice. Could that be it?

---

<div class="post-metadata">

**Author:** ![paubou](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/paubou/32/10761_2.png) [@paubou](https://forum.getkirby.com/u/paubou)\
**Post date:** [September 19, 2026, 12:08pm UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615/3 "2026-09-19T12:08:13Z")

</div>

Whoops. Thanks :). Edited my post. I still have the issue… !

---

<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:** [September 19, 2026, 6:25pm UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615/4 "2026-09-19T18:25:26Z")

</div>

Can confirm that there currently is no real support for Kirby queries for the `ratio` option, as it is used before the query is resolved. Opened a PR to fix it: [fix: Model image ratio as query by distantnative · Pull Request #8504 · getkirby/kirby · GitHub](https://github.com/getkirby/kirby/pull/8504)

---

<div class="post-metadata">

**Author:** ![paubou](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/paubou/32/10761_2.png) [@paubou](https://forum.getkirby.com/u/paubou)\
**Post date:** [October 19, 2026, 8:48am UTC](https://forum.getkirby.com/t/custom-cropratio-and-cover-true-for-the-image-settings-in-a-section-generates-an-error/35615/5 "2026-10-19T08:48:42Z")

</div>

I confirm that this has been fixed in Kirby 5.6.  
Thanks for the quick fix.
