Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass @id to IIIF layout #2612

Closed
edsilv opened this issue Mar 9, 2021 · 1 comment
Closed

Unable to pass @id to IIIF layout #2612

edsilv opened this issue Mar 9, 2021 · 1 comment

Comments

@edsilv
Copy link
Contributor

edsilv commented Mar 9, 2021

I'm using v0.27.2

When callng .tile passing the iiif layout, the resulting info.json does not have the correct @id.

sharp(image)
    .tile({
      layout: "iiif",
      id: "https://test.com"
    })
    .toFile(directory, (err, _info) => {
      resolve();
    }); 

This should result in:

{
  "@context": "http://iiif.io/api/image/2/context.json",
  "@id": "https://test.com/directory",

But it still uses the default example.com id:

{
  "@context": "http://iiif.io/api/image/2/context.json",
  "@id": "https://example.com/directory",

Ostensibly, the passed id should be used here in libvips: https://github.com/libvips/libvips/blob/master/libvips/foreign/dzsave.c#L1006

The id option appears to be missing here: https://github.com/lovell/sharp/blob/master/lib/output.js#L713

However, when I add:

    if (is.defined(options.id)) {
      if (is.string(options.id)) {
        this.options.id = options.id;
      } else {
        throw is.invalidParameterError('id', 'not a string', options.id);
      }
    }

in my local copy of Sharp, it's not making any difference to the outputted info.json...

What is the output of running npx envinfo --binaries --system?

  System:
    OS: Windows 10 10.0.18363
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
    Memory: 4.28 GB / 15.83 GB
  Binaries:
    Node: 14.15.3 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.5.1 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.13.7 - C:\Program Files\nodejs\npm.CMD
@lovell
Copy link
Owner

lovell commented Mar 29, 2021

This is now available in v0.28.0, thank you Edward!

@lovell lovell closed this as completed Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants