Skip to content

Commit

Permalink
[SERV-1068] Only set fallback thumbail on static images
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Apr 5, 2024
1 parent a29e582 commit ba1f4d4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ private Canvas[] createCanvases(final CsvHeaders aCsvHeaders, final List<String[

String resourceURI =
StringUtils.format(Constants.SAMPLE_URI_TEMPLATE, pageURI, Constants.DEFAULT_SAMPLE_SIZE);
boolean staticImage = false;
ImageResource imageResource;
ImageContent imageContent;
Canvas canvas;
Expand All @@ -494,6 +495,7 @@ private Canvas[] createCanvases(final CsvHeaders aCsvHeaders, final List<String[
imageResource = new ImageResource(accessURI);
imageResource.setWidth(mediaWidth);
imageResource.setHeight(mediaHeight);
staticImage = true;
} else {
// If we don't have both width and height in the CSV, we can also try to look it up
final ImageInfoLookup infoLookup = new ImageInfoLookup(pageURI);
Expand Down Expand Up @@ -524,7 +526,7 @@ private Canvas[] createCanvases(final CsvHeaders aCsvHeaders, final List<String[
// Add a thumbnail if we have one and one hasn't already been added
if (thumbnail.isPresent() && canvas.getThumbnail() == null) {
canvas.setThumbnail(thumbnail.get());
} else {
} else if (staticImage) {
// Fallback to using the original image as thumbnail and let browser resize
canvas.setThumbnail(accessURI);
}
Expand Down

0 comments on commit ba1f4d4

Please sign in to comment.