Reverted manifest thumbnail image.

This commit is contained in:
Michael Spalti
2021-09-04 17:34:12 -07:00
parent 015f1f2ac9
commit 39298006fb
2 changed files with 7 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ public class ManifestService extends AbstractResourceService {
// images in the ORIGINAL bundle will be used.
List<Bundle> bundles = utils.getIiifBundle(item, IIIF_BUNDLE);
List<Bitstream> bitstreams = utils.getBitstreams(bundles);
List<Bundle> thumbnailBundle = utils.getBundle(item, "THUMBNAIL");
// List<Bundle> thumbnailBundle = utils.getBundle(item, "THUMBNAIL");
Info info = utils.validateInfoForManifest(utils.getInfo(context, item, IIIF_BUNDLE), bitstreams);
manifestGenerator.setIdentifier(getManifestId(item.getID()));
manifestGenerator.setLabel(item.getName());
@@ -108,7 +108,7 @@ public class ManifestService extends AbstractResourceService {
addSearchService(item);
addMetadata(item.getMetadata());
addViewingHint(bitstreams.size());
addThumbnail(thumbnailBundle, context);
addThumbnail(bundles, context);
addSequence(item, bitstreams, context, info);
addRanges(info, item.getID().toString());
addSeeAlso(item);
@@ -223,9 +223,9 @@ public class ManifestService extends AbstractResourceService {
}
/**
* Adds thumbnail to the manifest. Uses the thumbnail in DSpace thumbnail bundle.
* @param bundles contain the THUMBNAIL bundle
* @param context DSpac context
* Adds thumbnail to the manifest. Uses first image in bundle.
* @param bundles image bundles
* @param context DSpace context
*/
private void addThumbnail(List<Bundle> bundles, Context context) {
List<Bitstream> bitstreams = utils.getBitstreams(bundles);

View File

@@ -105,7 +105,7 @@ public class IIIFRestRepositoryIT extends AbstractControllerIntegrationTest {
try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) {
bitstream2 = BitstreamBuilder
.createBitstream(context, publicItem1, is, "THUMBNAIL")
.createBitstream(context, publicItem1, is, IIIFBundle)
.withName("Bitstream2")
.withMimeType("image/jpeg")
.build();
@@ -119,7 +119,7 @@ public class IIIFRestRepositoryIT extends AbstractControllerIntegrationTest {
.andExpect(jsonPath("$.@context", is("http://iiif.io/api/presentation/2/context.json")))
.andExpect(jsonPath("$.service.profile", is("http://iiif.io/api/search/0/search")))
.andExpect(jsonPath("$.thumbnail.@id", Matchers.containsString("/iiif/2/"
+ bitstream2.getID())))
+ bitstream1.getID())))
.andExpect(jsonPath("$.sequences[0].canvases[0].@id",
Matchers.containsString("/iiif/" + publicItem1.getID() + "/canvas/c0")))
.andExpect(jsonPath("$.sequences[0].canvases[0].label", is("Page 1")))