Skip to content

fix: Improve ICO decoding and UI consistency#2

Open
TYK7 wants to merge 1 commit intofeat/color-scheme-extractorfrom
feat/logo-color-extraction
Open

fix: Improve ICO decoding and UI consistency#2
TYK7 wants to merge 1 commit intofeat/color-scheme-extractorfrom
feat/logo-color-extraction

Conversation

@TYK7
Copy link
Owner

@TYK7 TYK7 commented Jun 12, 2025

This commit addresses issues related to ICO file decoding and refines UI aspects for better consistency.

Changelog:

Backend:

  • Integrated Apache Commons Imaging library (1.0.0-alpha6) for more robust parsing of ICO files, particularly for logos.
  • Implemented a fallback mechanism to ImageIO if Commons Imaging fails to decode an ICO.
  • Enhanced stream handling in ColorExtractionService to allow multiple parsing attempts on logo image streams (using ByteArrayInputStream to ensure mark/reset support).
  • Improved logging around logo image decoding to provide more clarity on success/failure of different parsing attempts.
  • Added comprehensive unit tests in ColorExtractionServiceTest.java to cover various scenarios of ICO and non-ICO logo decoding, including success and failure paths for both Commons Imaging and ImageIO.

Frontend:

  • Corrected a CSS selector in color-input-display.component.css from .color-info p to .color-details p (and related strong tag selector) to ensure styles for color item details are correctly applied as per the HTML structure.
  • Verified that color names (defaulting to hex if no friendly name is available via ColorNamer) and sources are consistently passed from the backend and displayed in the UI.

These changes aim to improve the reliability of logo color extraction, especially for websites using ICO files as favicons/logos, and ensure that UI styles are applied as intended.

This commit addresses issues related to ICO file decoding and refines UI aspects for better consistency.

Changelog:

Backend:
- Integrated Apache Commons Imaging library (`1.0.0-alpha6`) for more robust parsing of ICO files, particularly for logos.
- Implemented a fallback mechanism to `ImageIO` if Commons Imaging fails to decode an ICO.
- Enhanced stream handling in `ColorExtractionService` to allow multiple parsing attempts on logo image streams (using `ByteArrayInputStream` to ensure `mark`/`reset` support).
- Improved logging around logo image decoding to provide more clarity on success/failure of different parsing attempts.
- Added comprehensive unit tests in `ColorExtractionServiceTest.java` to cover various scenarios of ICO and non-ICO logo decoding, including success and failure paths for both Commons Imaging and ImageIO.

Frontend:
- Corrected a CSS selector in `color-input-display.component.css` from `.color-info p` to `.color-details p` (and related `strong` tag selector) to ensure styles for color item details are correctly applied as per the HTML structure.
- Verified that color names (defaulting to hex if no friendly name is available via `ColorNamer`) and sources are consistently passed from the backend and displayed in the UI.

These changes aim to improve the reliability of logo color extraction, especially for websites using ICO files as favicons/logos, and ensure that UI styles are applied as intended.
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.

1 participant