Coder Social home page Coder Social logo

iiif's Introduction

IIIF

Build Status Go Report Card Coverage Status

A sample and quite dumb web server to serve pictures following the iiif API.

Image API Compliance Level 2 is reached.

Setup

libvips is required by bimg.

$ make deps
$ make

$ bin/iiif config.toml

$ DEBUG=iiif,bimg go test -v github.com/greut/iiif/iiif

IIIF image API 2.1

The API specifications can be found on iiif.io.

Identifier

  • filepath: the path of the file
  • url: the URL of the file (double // is replaced with a simple /)
  • base64(url): the URL of the file (encoded using base64)

Region

  • full: the full image
  • square: a square area in the picture (centered)
  • x,y,w,h: extract the specified region (as pixels)
  • pct:x,y,w,h: extract the specified region (as percentages)
  • smart: attempt to select the center of interest (subject to change as it is not part of IIIF)

Size

  • full: the full image (deprecated)
  • max: the full image
  • w,h: a potentially deformed image of w x h
  • !w,h: a non-deformed image of maximum w x h
  • w,: a non-deformed image with w as the width
  • ,h: a non-deformed image with h as the height
  • pct:n: a non-deformed image scaled by n percent

Rotate

  • n a clockwise rotation of n degrees
  • !n a flip is done before the rotation

limitations bimg only supports rotations that are multiples of 90.

Quality

  • color image in full colour
  • gray image in grayscale
  • bitonal image in either black or white pixels (not supported)
  • default image returned in the server default quality

Format

  • jpg
  • png
  • webp
  • tiff

limitations : bimg (libvips) doesn't support writing to gif, jp2 or pdf.

Profile

It provides all informations but the available sizes and tiles. The sizes information would be much better linked with a Cache system.

Level2 profile

It provides meta-informations about the service. (incomplete)

Viewers

Some viewers are supporting the iiif API out of the box. The following are included.

Features

Download

By adding ?dl to any image, it will trigger the Content-Disposition with attachement and download the file (ref). Otherwise, the Save as command will take a non-default.png filename.

HTTP

  • Cache-Control by default 1 year (the maximum value for HTTP/1.1).
  • ETag based on the full identifier (server independent).
  • Last-Modified headers based on the filesystem information or current time.

TODO

  • Adapt region for max when maxWidth, maxHeight and/or maxArea are specified.

Friendly projects

Protobuf

$ go get -u github.com/golang/protobuf/protoc-gen-go
$ PATH=$PATH:`pwd`/bin protoc --go_out=. iiif/image.proto

iiif's People

Contributors

golint-fixer avatar greut avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.