Skip to content
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

Missing alignment default value in image constructor #424

Closed
mloskot opened this issue Jan 19, 2020 · 6 comments · Fixed by #429
Closed

Missing alignment default value in image constructor #424

mloskot opened this issue Jan 19, 2020 · 6 comments · Fixed by #429
Assignees
Labels
cat/bug But reports and bug fixes core boost/gil good-first-issue Opportunity for new contributors to help improving GIL
Milestone

Comments

@mloskot
Copy link
Member

mloskot commented Jan 19, 2020

Actual behavior

Unlike all the other constructors, this one does not receive default value alignment = 0

image(const point_t& dimensions,
const Pixel& p_in,
std::size_t alignment,
const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
, _allocated_bytes( 0 ) {
allocate_and_fill(dimensions, p_in);
}

#include <boost/gil.hpp>
namespace gil = boost::gil;
int main()
{
    gil::point_t dims{32, 32};
    gil::bgr8_pixel_t p{32, 64, 128};
    gil::bgr8_image_t i(dims, p);
      // image(const point_t& dimensions, const Pixel& p_in, std::size_t alignment, const Alloc alloc_in = Alloc())
      // constructor is not picked up, compilation fails
}

Expected behavior

gil::bgr8_image_t i(dims, p); should pick the expected constructor.

References

Environment

  • Compiler version: GCC 9.2, clang 9.0, VS 2017, VS 2019
@mloskot mloskot added cat/bug But reports and bug fixes core boost/gil labels Jan 19, 2020
@mloskot mloskot added this to the Boost 1.73 milestone Jan 19, 2020
@mloskot mloskot self-assigned this Jan 19, 2020
@mloskot mloskot added the good-first-issue Opportunity for new contributors to help improving GIL label Jan 19, 2020
@parthsarthi1
Copy link

parthsarthi1 commented Jan 19, 2020

@mloskot can I try to look into the issue to learn more about GIL. thanks.

@mloskot
Copy link
Member Author

mloskot commented Jan 20, 2020

@parthsarthi1 You're welcome to take care of it and submit PR. No tests need to be added for it because #423 will add some (I'll update that PR as soon as your PR is merged).

You should try to compile the minimal example from the description to see if your fix works though.

@ArbitCode
Copy link
Contributor

@mloskot I think this issue is resolved as while I'm trying to find the issue. I haven't seen any issues.

@mloskot
Copy link
Member Author

mloskot commented Jan 21, 2020

@ArbitCode What compiler did you use? What C++ standard version?

@ArbitCode
Copy link
Contributor

ArbitCode commented Jan 21, 2020

sorry, Actually that time it does not show the error when I was finding bugs, Now it shows error.
FYI gcc 9.2. This is the right compiler, isn't it?

@mloskot
Copy link
Member Author

mloskot commented Jan 21, 2020

@ArbitCode So, you confirm the issue. Good.

I added list of compilers that I tried to the description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat/bug But reports and bug fixes core boost/gil good-first-issue Opportunity for new contributors to help improving GIL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants