# Images in scribbles

**URL:** <https://racket.discourse.group/t/images-in-scribbles/4178>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [April 4, 2026, 8:16am UTC](https://racket.discourse.group/t/images-in-scribbles/4178 "2026-04-04T08:16:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hnmdijkema](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hnmdijkema/32/2629_2.png) [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Post date:** [April 4, 2026, 8:16am UTC](https://racket.discourse.group/t/images-in-scribbles/4178/1 "2026-04-04T08:16:59Z")

</div>

I’ve got an image in a scribble, and it works in my local setup,but when I try to distributie my package, jt fails,because raco does not find it. What can I do to solve this?

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [April 4, 2026, 6:20pm UTC](https://racket.discourse.group/t/images-in-scribbles/4178/2 "2026-04-04T18:20:29Z")

</div>

Can you show the snippet that fails?

---

<div class="post-metadata">

**Author:** ![hnmdijkema](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hnmdijkema/32/2629_2.png) [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Post date:** [April 4, 2026, 7:46pm UTC](https://racket.discourse.group/t/images-in-scribbles/4178/3 "2026-04-04T19:46:10Z")

</div>

Yes, sure, thank you for looking into it:

```scheme
#lang scribble/manual

@title{Qt WebView Backend Architecture}
@author[@author+email["Hans Dijkema" "hans@dijkewijk.nl"]]

@section{Introduction}

It would, of course, be preferable to place everything within a single process,
under a unified structure. This would be elegant. It is not how things are.

@centered{
  @image[#:scale 0.45]{rktwebview-shared-memory-diagram-simple.svg}
}

Qt WebEngine establishes its own order: threads, event loops, internal state.
Once set in motion, it does not easily yield. It persists, and it expects its
environment to adapt accordingly. These conditions are accepted.

The Racket process, however, is of a different nature. It is light, precise,
capable of starting and stopping without residue. It must remain so.

So a boundary is drawn.

On one side, Qt: a large, immovable instrument—something like an organ. Once it
begins to sound, it fills the space, and it is not easily silenced. On the other,
Racket: a violin, agile and expressive, able to begin and end a phrase at will.

They do not become the same instrument. They are allowed to play together.
Communication is arranged accordingly. A shared memory region, containing three
queues: commands, results, and events. A command is issued. It crosses the boundary. It is taken up and executed. A result returns.
Events also arise, independently, and must be handled when they appear.

(...)

```

---

<div class="post-metadata">

**Author:** ![hnmdijkema](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hnmdijkema/32/2629_2.png) [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Post date:** [April 4, 2026, 7:54pm UTC](https://racket.discourse.group/t/images-in-scribbles/4178/4 "2026-04-04T19:54:54Z")

</div>

Currently, I'm trying this:

```scheme
@section{Introduction}

It would, of course, be preferable to place everything within a single process,
under a unified structure. This would be elegant. It is not how things are.

@(define-runtime-path img-path ".")
@(define img (path->string (build-path img-path
                                       "rktwebview-shared-memory-diagram-simple.svg"
                                       )))
@(displayln (format "image: '~a'" img))

@centered{
  @image[#:scale 0.45]{@img}
}

Qt WebEngine establishes its own order: threads, event loops, internal state.

```

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [April 4, 2026, 9:13pm UTC](https://racket.discourse.group/t/images-in-scribbles/4178/5 "2026-04-04T21:13:27Z")

</div>

I would expect something like this to work:

```scheme
#lang scribble/manual
@(require racket/runtime-path)

@(define-runtime-path img "images/example.png")

@title{My Docs}

Here is the image:

@image[img]

```

Where the file structure is:

```scheme
my-package/
  info.rkt
  scribblings/
    manual.scrbl
    images/
      logo.png
```

---

<div class="post-metadata">

**Author:** ![hnmdijkema](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hnmdijkema/32/2629_2.png) [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Post date:** [April 4, 2026, 9:45pm UTC](https://racket.discourse.group/t/images-in-scribbles/4178/6 "2026-04-04T21:45:55Z")

</div>

Yes that worked, but now I seem to be getting a new problem:

```scheme
raco test: 0 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/example1/example.rkt")
raco test: 1 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/info.rkt")
raco test: 1 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/main.rkt")
main.rkt: racket test: #<<non-empty stderr
Cannot load librktwebview.so.
Make sure you installed Qt6 on your system
NB. the minimum Qt version that is supported is Qt 6.10.
This probably means you will need to install it separately from
the standard distro packages (e.g. libqt6webenginewidgets6 on
debian based systems).

Exception:

#(struct:exn:fail:filesystem ffi-lib: could not load foreign library
  path: /home/root/user/.local/share/racket/9.1/pkgs/racket-webview/private/lib/linux/x86_64/librktwebview.so.6
  system error: /home/root/user/.local/share/racket/9.1/pkgs/racket-webview/private/lib/linux/x86_64/librktwebview.so.6: cannot open shared object file: No such file or directory #<continuation-mark-set>)
  context...:
   /home/root/racket/collects/racket/private/more-scheme.rkt:163:2: select-handler/no-breaks
   body of "/home/root/user/.local/share/racket/9.1/pkgs/racket-webview/private/racket-webview-qt.rkt"
   /home/root/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt:98:2
   body of (submod "/home/root/racket/share/pkgs/compiler-lib/compiler/commands/test.rkt" process)
   body of top-level

```

Although it works on my Linux (mint) box and Windows system:

```scheme

(define-runtime-path lib-dir "lib")

(define ffi-library
  (cond
   ([eq? os 'windows] 'rktwebview.dll)
   ([eq? os 'linux] 'librktwebview.so)
   )
  )

(define os-lib-dir (build-path lib-dir (symbol->string os) (symbol->string arch)))

(define (libname lib-symbol)
  (build-path os-lib-dir (symbol->string lib-symbol)))

(define rktwebview-prg (if (eq? os 'windows)
                           "rktwebview_prg.exe"
                           "rktwebview_prg"))

(define webengine-process (if (eq? os 'windows)
                             "QtWebEngineProcess.exe"
                             "QtWebEngineProcess"))

(define webview-lib-file (libname ffi-library))
(define webview-lib
  (with-handlers ([exn:fail?
                   (λ (exp)
                     (cond
                       ([eq? os 'linux]
                        (error (format
                                (string-append "Cannot load ~a.\n"
                                               "Make sure you installed Qt6 on your system\n"
                                               "NB. the minimum Qt version that is supported is Qt 6.10.\n"
                                               "This probably means you will need to install it separately from\n"
                                               "the standard distro packages (e.g. libqt6webenginewidgets6 on\n"
                                               "debian based systems).\n"
                                               "\n"
                                               "Exception:\n\n~a")
                                ffi-library exp)))
                       (else (error
                              (format "Cannot load ~a for os ~a\n\nException:\n\n~a"
                                      ffi-library os exp))))
                     )
                   ])
    (ffi-lib webview-lib-file '("6" #f)
             #:get-lib-dirs (list os-lib-dir)
             ;#:custodian (current-custodian)
             )
    )
  )

(define-ffi-definer define-rktwebview webview-lib)

```

Maybe the `lib` directory is not copied?

---

<div class="post-metadata">

**Author:** ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)\
**Post date:** [April 5, 2026, 8:37am UTC](https://racket.discourse.group/t/images-in-scribbles/4178/7 "2026-04-05T08:37:27Z")

</div>

Is the error below from the package server?

If so, you need to read the fine print of this:

> **[Racket: About Package Builds](https://pkg-build.racket-lang.org/about.html)**

Basically, you need to make packages for the native libraries,  
so the package server can install `librktwebview.so` before building the main package.

```scheme
raco test: 0 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/example1/example.rkt")
raco test: 1 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/info.rkt")
raco test: 1 (file "/home/root//user/.local/share/racket/9.1/pkgs/racket-webview/main.rkt")
main.rkt: racket test: #<<non-empty stderr
Cannot load librktwebview.so.
Make sure you installed Qt6 on your system
NB. the minimum Qt version that is supported is Qt 6.10.
This probably means you will need to install it separately from
the standard distro packages (e.g. libqt6webenginewidgets6 on
debian based systems).

Exception:

#(struct:exn:fail:filesystem ffi-lib: could not load foreign library
  path: /home/root/user/.local/share/racket/9.1/pkgs/racket-webview/private/lib/linux/x86_64/librktwebview.so.6
 

```

---

<div class="post-metadata">

**Author:** ![hnmdijkema](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/hnmdijkema/32/2629_2.png) [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Post date:** [April 5, 2026, 11:51am UTC](https://racket.discourse.group/t/images-in-scribbles/4178/8 "2026-04-05T11:51:21Z")

</div>

Oh, bummer. I'll look into that. Thanks for pointing that out. I saw those platform dependent packages in the list of packages, thought that was a (odd) design choice of the creator, but now I understand it is a requirement of the package builder.
