nulib / images

Hydra based image application
https://images.northwestern.edu/
3 stars 1 forks source link

images not displaying on images (iiif?) #434

Closed davidschober closed 5 years ago

davidschober commented 5 years ago

Severity

Is the production site running?

Are staff blocked from performing their work?

Descriptive summary

Some images and / or thumbnails are not displaying on image.northwestern.edu. It's possible the images that are displaying are already cached by RIIIF.

Images that do not display error when hitting the iiif server directly https://images.northwestern.edu/image-service/inu-dil-cea91f6b-3217-40ea-a8ff-d8b8d3e2e6ad/full/full/0/default.jpg

Steps to reproduce the behavior

davidschober commented 5 years ago

A few different things happened here.

Slack discussion

mbklein [10:54 AM] I’ll check

Nope. Never mind. I don’t need to. Ugh. The key is based on the MD5 of the URL, which is going to be impossible to figure out based on the URL prefix. Maybe I can do that one jpg though.

mbklein [11:08 AM] Almost there.

mbklein [11:19 AM] Success http://images.northwestern.edu/image-service/inu-dil-5f4c79ec-9f65-4e41-88aa-b4f1e128829b/full/,120/0/default.jpg http://images.northwestern.edu/image-service/inu-dil-5f4c79ec-9f65-4e41-88aa-b4f1e128829b/full/,120/0/default.jpg

david.schober [11:19 AM] whoot! So we know it's the cache

mbklein [11:21 AM] Can you find me another bad one? I want to check something and I’ve already blown away that one. :slightly_smiling_face:

david.schober [11:21 AM] Sure! There's a lot of 'em it's like fishing in the north woods http://images.northwestern.edu/image-service/inu-dil-c9c1ab35-8cfe-433e-91f4-a4749367216b/full/,120/0/default.jpg

mbklein [11:23 AM] Aha! Progress!

david.schober [11:23 AM] Frankly I think its everything that I preprimed (first page of all public collections) which fits nicely into the Karen Theory of non-randomized Image Entropy (edited)

mbklein [11:28 AM] I found the commonality. It’s easy once you know an item’s cache key.

david.schober [11:29 AM] come on man, you're killing me!

mbklein [11:29 AM] Rails.cache.fetch(key) is an empty string for the busted items. I’ve cleared out just those 224 items.

davidschober commented 5 years ago

FOR THE RECORD:

def riiif_cache_key_for(url)
  opts = {}
  (id, opts[:region], opts[:size], opts[:rotation], opts[:quality], opts[:format]) = URI.parse(url).path.split(%r{[/.]})[-6..-1]
  decoded = Riiif::Image.new(id).send(:decode_options!, opts)
  Riiif::Image.cache_key(id, decoded).gsub(/:/,'%3A')
end