Skip to content

Commit 188a0b6

Browse files
committed
Force max thumbnail size in CSS to scale down SVGs
1 parent 0c04e4a commit 188a0b6

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

webapp/src/Controller/Jury/SubmissionController.php

+1
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@ public function viewAction(
581581
'requestedOutputCount' => $requestedOutputCount,
582582
'version_warnings' => [],
583583
'isMultiPassProblem' => $submission->getProblem()->isMultipassProblem(),
584+
'thumbnailSize' => $this->config->get('thumbnail_size'),
584585
];
585586

586587
if ($selectedJudging === null) {

webapp/src/Controller/Team/SubmissionController.php

+1
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public function viewAction(Request $request, int $submitId): Response
200200
'showSampleOutput' => $showSampleOutput,
201201
'runs' => $runs,
202202
'showTooLateResult' => $showTooLateResult,
203+
'thumbnailSize' => $this->config->get('thumbnail_size'),
203204
];
204205
if ($actuallyShowCompile) {
205206
$data['size'] = 'xl';

webapp/templates/jury/submission.html.twig

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
.judging-table tr.disabled td a {
2020
color: silver
2121
}
22+
23+
.image_thumb {
24+
max-width: {{ thumbnailSize }}px;
25+
max-height: {{ thumbnailSize }}px;
26+
}
2227
</style>
2328
{% endblock %}
2429
@@ -742,7 +747,7 @@
742747
<span style="float:right; border: 3px solid #438ec3; margin: 5px; padding: 5px;">
743748
{% set imgUrl = path('jury_problem_testcase_fetch', {'probId': submission.problem.probid, 'rank': run.rank, 'type': 'image'}) %}
744749
<a href="{{ imgUrl }}">
745-
<img src="data:{{ run.imageType | extensionToMime }};base64,{{ runsOutput[runIdx].image_thumb | base64 }}"/>
750+
<img class="image_thumb" src="data:{{ run.imageType | extensionToMime }};base64,{{ runsOutput[runIdx].image_thumb | base64 }}"/>
746751
</a>
747752
</span>
748753
{% endif %}

0 commit comments

Comments
 (0)