IQSS / IQSS/dataverse

Thumbnail API should not allow arbitrary sizes

Open
#10,152 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

Our thumbnail generating API will take any arbitrary number and re-scale an image to that size (horizontally; preserving the original pixel ratio).

For some reason, there is an old, and still open issue #5679 which appears to request that "We should add the ability to specify the thumbnail size in the API". Did we forget to close it? Our API does allow arbitrary thumbnail sizes, and that's a problem. There are also open issues where people are specifically asking for higher res./larger thumbnails on various pages. Not to worry, that by itself is not a problem. If people want to have larger thumbnails in the new UI than the current 64 px., sure, why not. But there is no need for the API to accept literally any number that is passed to it.

Maybe it should only allow the few standard sizes that are used by the known pages, plus any sizes specifically configured by the instance admins. But at the very, very least there should be a hard upper size limit. For the larger previews on the current dataset and file pages we scale to 400 px in width. That seems like a sensible max. size to me (but maybe should be configurable as well). But there is absolutely never a good reason to allow to scale an already large image to an even larger size.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the thumbnail-generating API entry point described in the issue and trace how requested widths are validated and configured. Review the existing thumbnail sizes used by dataset and file pages, then define and test enforcement of a hard maximum or configured limit; done means oversized requests are rejected or constrained without breaking supported sizes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.