Skip to content

Commit

Permalink
Support for ImageService3
Browse files Browse the repository at this point in the history
Also added new ImageService2Reference that inherits from ResourceBase so we can use the Profile property
  • Loading branch information
ra-magnus-welander committed Jan 11, 2022
1 parent ae06e3b commit 5366a4b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/IIIF/IIIF/ImageApi/Service/ImageService3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using IIIF.Presentation.V3;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace IIIF.ImageApi.Service
{
public class ImageService3 : ResourceBase, IService
{
public const string Image3Context = "http://iiif.io/api/image/3/context.json";
public const string ImageProtocol = "http://iiif.io/api/image";

public ImageService3()
{
Context = Image3Context;
}

public override string Type => nameof(ImageService3);

[JsonProperty(Order = 3)]
public string Protocol => ImageProtocol;

[JsonProperty(Order = 11)]
public int Width { get; set; }

[JsonProperty(Order = 12)]
public int Height { get; set; }

[JsonProperty(Order = 13)]
public List<Size> Sizes { get; set; }

[JsonProperty(Order = 14)]
public List<Tile> Tiles { get; set; }

[JsonProperty(Order = 30)]
public List<string> ExtraFeatures { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/IIIF/IIIF/Presentation/V2/ImageService2Reference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using IIIF.ImageApi.Service;
using System;

namespace IIIF.Presentation.V2
{
public class ImageService2Reference : ResourceBase, IService
{
public override string Type
{
get => nameof(ImageService2);
set => throw new NotImplementedException();
}
}
}
9 changes: 9 additions & 0 deletions src/IIIF/IIIF/Presentation/V3/ImageService3Reference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using IIIF.ImageApi.Service;

namespace IIIF.Presentation.V3
{
public class ImageService3Reference : ResourceBase, IService
{
public override string Type => nameof(ImageService3);
}
}

0 comments on commit 5366a4b

Please sign in to comment.