Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

test: fix encodeBmp equality checks #489

Merged
merged 2 commits into from
Jul 25, 2025
Merged

test: fix encodeBmp equality checks #489

merged 2 commits into from
Jul 25, 2025

Conversation

targos
Copy link
Member

@targos targos commented Jul 25, 2025

No description provided.

@targos targos requested a review from EscapedGibbon July 25, 2025 07:11
@targos
Copy link
Member Author

targos commented Jul 25, 2025

@EscapedGibbon can you take this over and investigate why the tests are failing? I don't know if we need to fix the tests or the code.

@EscapedGibbon
Copy link
Collaborator

EscapedGibbon commented Jul 25, 2025

CleanShot 2025-07-25 at 09 42 15

@targos the cause of this is in the way we encode bmp but i wouldn't call it a bug. As you can see there is a difference in some of the fields between the image from data(data at the top of image) and test image(data at the bottom of image). It happens because we usually store this data during bmp decoding and pass it to encoder. But, since image-js format doesn't store such specific data, encoder just fills it with default values.

Default values were chosen with GIMP specs in mind, so if we overwrite images in GIMP the tests will pass

CleanShot 2025-07-25 at 10 27 50

@EscapedGibbon
Copy link
Collaborator

On the sidenote, I think it would be nice to include bmp decoder in image-js as well.

Copy link

codecov bot commented Jul 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.66%. Comparing base (7c00be1) to head (4f859e5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #489   +/-   ##
=======================================
  Coverage   98.66%   98.66%           
=======================================
  Files         246      246           
  Lines       10645    10645           
  Branches     2171     2171           
=======================================
  Hits        10503    10503           
  Misses        142      142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@targos
Copy link
Member Author

targos commented Jul 25, 2025

Thanks!

@targos targos merged commit 1f2d3a8 into main Jul 25, 2025
11 checks passed
@targos targos deleted the encode-bmp-test branch July 25, 2025 11:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants