Skip to content

Update photo upload validation and storage code#322

Merged
josh-uk merged 8 commits into
masterfrom
FACT-2167-court-photo
Jul 22, 2026
Merged

Update photo upload validation and storage code#322
josh-uk merged 8 commits into
masterfrom
FACT-2167-court-photo

Conversation

@hurricanepilot

Copy link
Copy Markdown
Contributor

JIRA link

FACT-2167

Change description

Changes to photo upload:

  • tweaks to validation code to allow more valid jpg/jpeg images through
  • configurable resizing before upload to ensure rendered image on screen

Does this PR require manual testing? (check one with "x")

[ ] Yes
[x] No

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

return "png";
}
if (lower.contains("jpeg") || lower.contains("jpg")) {
return "jpg";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please declare jpg, png as constant.

int maxWidth = photoConfigurationProperties.getMaxWidth();

try {
BufferedImage sourceImage = ImageIO.read(new ByteArrayInputStream(file.getBytes()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably BufferedImage sourceImage = ImageIO.read(file.getInputStream()); will be more memory efficient, might be wrong.

Use file.getInputStream() in ImageIO read method
created constants for file types
@josh-uk
josh-uk merged commit 5095868 into master Jul 22, 2026
8 checks passed
@josh-uk
josh-uk deleted the FACT-2167-court-photo branch July 22, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants