Skip to content

fix(scan): restore MRI preview rendering and align analysis badge#66

Open
aarushlohit wants to merge 5 commits into
Brijeshthummar02:masterfrom
aarushlohit:fix/mri-preview-badge-alignment
Open

fix(scan): restore MRI preview rendering and align analysis badge#66
aarushlohit wants to merge 5 commits into
Brijeshthummar02:masterfrom
aarushlohit:fix/mri-preview-badge-alignment

Conversation

@aarushlohit

Copy link
Copy Markdown

Summary

Fixes the MRI Scan preview issue where uploaded MRI files displayed a broken image placeholder instead of a valid preview, and aligns the "Ready for Analysis" badge for improved UI consistency.

Closes #61


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

MRI Preview Fix

  • Replaced preview rendering with URL.createObjectURL(file)
  • Added cleanup using URL.revokeObjectURL
  • Hid preview image until successful load
  • Added fallback handling for unsupported image formats (e.g., TIFF MRI scans)
  • Added friendly fallback preview state instead of displaying a broken image icon

Badge Alignment Fix

  • Centered the "Ready for Analysis" badge vertically
  • Improved layout stability using flex alignment
  • Verified responsive behavior across different viewport sizes

Root Cause

TIFF MRI files passed validation but Chromium cannot render image/tiff files directly inside an <img> element. This caused the preview to fail and display a broken image icon.


Validation Performed

  • TIFF MRI upload
  • PNG upload
  • JPG upload
  • Upload → Remove → Upload flow
  • Invalid file handling
  • Responsive layout verification
  • Badge alignment verification

Screenshots

Before

image

Broken MRI preview and badge alignment issue.

After

image

MRI preview fallback handling works correctly and badge is centered.


Files Modified

  • templates/index.html
  • static/js/script.js
  • static/css/style.css

Additional Notes

This fix prevents broken image placeholders for unsupported MRI formats while maintaining a clear indication that the uploaded scan is ready for analysis.

@Brijeshthummar02

Copy link
Copy Markdown
Owner

@aarushlohit remove ready for analysis written there. also show me scan part ss too when entire process takes place over there, image preview was broken. refer issue ss for it.

@aarushlohit

Copy link
Copy Markdown
Author

@aarushlohit remove ready for analysis written there. also show me scan part ss too when entire process takes place over there, image preview was broken. refer issue ss for it.

Thank you for the review.

I'll update the implementation by removing the duplicate "Ready for Analysis" text/badge from the fallback preview section and keep the status indicator only in its designated location.

I'll also upload additional screenshots demonstrating the actual image preview rendering correctly for supported image formats (PNG/JPG), along with the complete upload flow, so the fix for the broken preview can be verified against the issue requirements.

Updating the PR shortly.

@Brijeshthummar02

Copy link
Copy Markdown
Owner

resolve merge conflict

@aarushlohit

Copy link
Copy Markdown
Author

resolve merge conflict

Okay

@aarushlohit

Copy link
Copy Markdown
Author

Updated PR #66 for Issue #61.

  • Merge conflict with latest origin/master resolved and branch pushed.
  • Duplicate fallback status badge removed from the TIFF/unsupported preview fallback.
  • PNG/JPG/JPEG/WebP preview validation now uses supported browser preview types before creating the object URL.
  • PNG and JPG uploads render actual blob: image previews instead of fallback.
  • TIFF upload now goes directly to the friendly fallback with no broken image placeholder and no duplicate "Ready for Analysis" badge.
  • Re-tested upload/remove/upload flow and responsive fallback layout.
  • Verified badge alignment for supported previews.

Screenshots added:

  • screenshots/after-png-preview.png
  • screenshots/after-jpg-preview.png
  • screenshots/after-tiff-fallback.png

Commit: 0ae83dc

@aarushlohit

Copy link
Copy Markdown
Author

Resolved the remaining GitHub merge conflicts against Brijeshthummar02/NeuroVision:master.

  • Fetched and merged the upstream base repository directly.
  • Resolved conflicts in README.md and static/css/style.css.
  • Kept upstream README/LICENSE changes.
  • Preserved the MRI preview fallback fixes and badge alignment changes.
  • Re-captured preview screenshots after the conflict resolution:
    • screenshots/after-png-preview.png
    • screenshots/after-jpg-preview.png
    • screenshots/after-tiff-fallback.png
  • Re-tested PNG, JPG, remove/reupload, TIFF fallback, and responsive width.
  • Verified no conflict markers, no staged whitespace issues, and JS syntax passes.

Latest commit: ba8724d
GitHub mergeability now reports: CLEAN / MERGEABLE.

@aarushlohit

Copy link
Copy Markdown
Author

@Brijeshthummar02 fixed now for review

@Brijeshthummar02

Copy link
Copy Markdown
Owner

@aarushlohit 1 single commit only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix Broken MRI Scan Preview & Align "Ready for Analysis" Badge

2 participants