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

Dezoomify doesn't work on https://collection.barnesfoundation.org/objects/7199/Le-Bonheur-de-vivre-also-called-The-Joy-of-Life/ #230

Open
henryfo55 opened this issue Feb 26, 2024 · 5 comments

Comments

@henryfo55
Copy link

Dezoomify doesn't work on https://collection.barnesfoundation.org/objects/7199/Le-Bonheur-de-vivre-also-called-The-Joy-of-Life/

@DigitalCurator
Copy link

DigitalCurator commented Mar 2, 2024

[Resolved]

@henryfo55
Copy link
Author

henryfo55 commented Mar 3, 2024 via email

@CharlyAlonso
Copy link

Indeed, it is a good question.

Please DigitalCurator, would you tell us how you got it?

Thanks and best regards,

@CharlyAlonso
Copy link

Hello, how are you?
Applying this .yaml I manage to download the image:

url_template: "https://d2r83x5xt28klo.cloudfront.net/tiles/7199/{{x}},{{y}},256,256/256,/0/color.jpg"
variables:

  • { name: x, from: 0, to: 9984, step: 256 } # Image width, in pixels.
  • { name: y, from: 0, to: 9984, step: 256 } # Image height, in pixels

But, the problem is that I can't download the last row and column.

Any suggestions?

Thanks and best regards,

@peterldowns
Copy link

@CharlyAlonso I figured this out, here's a step-by-step to download images from the Barnes collection:

  • Open the image page on the Barnes website for the painting you want to dezoomify.

  • Take the "object id" from the URL

    • In this case that's 7199
  • Open the tile information JSON in your browser, from url https://d2r83x5xt28klo.cloudfront.net/tiles/OBJECT_ID/info.json

  • The Barnes is using IIIF for their image tiles, but this JSON that they serve isn't quite right for dezoomify-rs to download it. You'll need to create your own custom input.json based on it. All you need from this file is the width and height values.

    • In this case the width is 5100 and the height is 3704.
  • On your computer, using any plaintext editor (Notepad.exe, TextEdit, vim, vscode, whatever) create a file input-OBJECT_ID.json.

    • In this case it should be called input-7199.json.
    • Use this template and replace OBJECT_ID, WIDTH, and HEIGHT with the values from above:
{
  "@context": "http://iiif.io/api/image/2/context.json",
  "@id": "https://d2r83x5xt28klo.cloudfront.net/tiles/OBJECT_ID",
  "@type": "iiif:Image",
  "protocol": "http://iiif.io/api/image",
  "width": WIDTH,
  "height": HEIGHT,
  "tiles": [
    {
      "width": 256,
      "scaleFactors": [
        1
      ]
    }
  ],
  "profile": [
    {
      "formats": [
        "jpg",
      ],
      "qualities": [
        "color"
      ],
      "supports": [
        "regionByPx",
        "sizeByW"
      ]
    }
  ]
}
  • In this case the final result will be a file called input-7199.json and its contents will be
{
  "@context": "http://iiif.io/api/image/2/context.json",
  "@id": "https://d2r83x5xt28klo.cloudfront.net/tiles/7199",
  "@type": "iiif:Image",
  "protocol": "http://iiif.io/api/image",
  "width": 5100,
  "height": 3704,
  "tiles": [
    {
      "width": 256,
      "scaleFactors": [
        1
      ]
    }
  ],
  "profile": [
    {
      "formats": [
        "jpg",
      ],
      "qualities": [
        "color"
      ],
      "supports": [
        "regionByPx",
        "sizeByW"
      ]
    }
  ]
}
  • Download the image!
$ mkdir -p ./tile-cache
$ dezoomify-rs --tile-cache ./tile-cache --dezoomer iiif -H ./input-7199.json ./output-7199.jpg

In case you just wanted this image, here's the result. The same steps above will work for other images. The jpg that @DigitalCurator posted is slightly different than the one from the Barnes (slightly lower resolution; slightly more vivid colors), so I assume they sourced it somewhere else.

Remember, by default the compression level for jpegs is 20 (0 is no compression, 100 is most compression.)
output-7199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants