Unable to read Cantaloupe context keys in delegates.rb when using Mirador

34 views
Skip to first unread message

Arthur Trip

unread,
Aug 5, 2022, 9:53:04 AM8/5/22
to IIIF Discuss

Hello everybody,
I need to use the Cantaloupe delegates.rb to be able to apply different overlays based on the characteristics of the url used (eg. different URL domain means different overlay to use).
But I have a trivial problem: I can't read any of the interesting context keys when using Mirador: identifier, local_uri, request_uri.
To be precise:

  1. I use Cantaloupe 5.0.5 through Mirador 3
  2. The keys of my interest are valued only if I invoke Cantaloupe directly and not via Mirador.
  3. The only key that works both directly and via Mirador is client_ip (in my case it is of no use).

For example, this produces the correct key value of 'local_uri' only when calling Cantaloupe directly without using Mirador.

   def overlay(options = {})
    {
      'string' => context['request_uri'],
      'position' => 'center',
      'inset' => 5,
      'font' => 'Helvetica',
      'font_size' => 20,
      'font_min_size' => 18,
      'font_weight' => 1.0,
      'color' => 'rgba(128, 128, 128, 100)',
      'background_color' => 'rgba(0, 0, 0, 10)',
      'glyph_spacing' => 0,
      'stroke_color' => 'rgba(128, 128, 128, 100)',
      'stroke_width' => 1,
      'word_wrap' => false
    }
  end

Has anyone had similar experiences and any suggestions in this regard?
Thanks in advance for any response.

Arthy

Arthur Trip

unread,
Sep 29, 2022, 6:55:59 AM9/29/22
to IIIF Discuss
Forget it.
I solved the problem which was simply due to the excessive length of the text strings never displaying on too small images used as an example.
Reply all
Reply to author
Forward
0 new messages