Skip to content

32bit rgb bmp file should not copy data as rgba #20916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2021

Conversation

Harvey-Huang
Copy link
Contributor

@Harvey-Huang Harvey-Huang commented Oct 21, 2021

Merge with extra: opencv/opencv_extra#927

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@Harvey-Huang
Copy link
Contributor Author

fixed bug, I found that opencv always copy 32 bit bmp data as rgba(4 channels), but rgb data can set as 32 bit pre pixel too, so we need to check BI_RGB, I have added the test file test_32bit_rgb.bmp to opencv_extra repo.

@alalek
Copy link
Member

alalek commented Oct 21, 2021

Thank you for contribution!

As a bug fix this patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Please rebase related opencv_extra PR too.

@Harvey-Huang Harvey-Huang changed the base branch from master to 3.4 October 21, 2021 07:27
@Harvey-Huang
Copy link
Contributor Author

I have pushed my change to 3.4, please check, thank you!

@alalek
Copy link
Member

alalek commented Oct 21, 2021

wants to merge 2,475 commits

needs to force push to the branch 32bit_rgb

@alalek
Copy link
Member

alalek commented Oct 21, 2021

Thank you for update!

+78.4 KB testdata/highgui/readwrite/test_32bit_rgb.bmp

Could you please to put small image to opencv_extra? E.g. 16x16 or 64x64 pixels shuold be enough.

@Harvey-Huang
Copy link
Contributor Author

I pushed an image which is 48x48 pixels

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Well done! Thank you 👍

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