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

[SERV-1068] Only set fallback thumbail on static images #239

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ ignore:
- '*':
reason: Service is deprecated; moving to GoLang
expires: 2024-12-01
'SNYK-JAVA-IONETTY-6483812':
- '*':
reason: Service is deprecated; moving to GoLang
expires: 2024-12-01
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<ubuntu.tag>22.04</ubuntu.tag>
<jdk.version>17.0.10+7-1~22.04.1</jdk.version>
<python3.version>3.10.6-1~22.04</python3.version>
<curl.version>7.81.0-1ubuntu1.15</curl.version>
<curl.version>7.81.0-1ubuntu1.16</curl.version>

<!-- Application dependencies -->
<vertx.version>3.9.16</vertx.version>
Expand Down
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
Loading
Loading