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

scanlne_reader for istream not worked #578

Open
fsmoke opened this issue Mar 15, 2021 · 0 comments
Open

scanlne_reader for istream not worked #578

fsmoke opened this issue Mar 15, 2021 · 0 comments

Comments

@fsmoke
Copy link

fsmoke commented Mar 15, 2021

Actual behavior

Code not compiles on msvc 16.9.1

see piece of build log below

1>  d:\libraries\boost_1_75_0\boost\gil\io\get_reader.hpp(160,62): error C2039: 'type': is not a member of 'boost::gil::get_read_device<T,FormatTag,void>'
1>          with
1>          [
1>              T=std::ifstream,
1>              FormatTag=boost::gil::image_read_settings<boost::gil::jpeg_tag>
1>          ]
1>  d:\libraries\boost_1_75_0\boost\gil\io\get_reader.hpp(160): message : see declaration of 'boost::gil::get_read_device<T,FormatTag,void>'
1>          with
1>          [
1>              T=std::ifstream,
1>              FormatTag=boost::gil::image_read_settings<boost::gil::jpeg_tag>
1>          ]
1>  d:\libraries\boost_1_75_0\boost\gil\io\make_scanline_reader.hpp(95): message : see reference to class template instantiation 'boost::gil::get_scanline_reader<Device,boost::gil::image_read_settings<boost::gil::jpeg_tag>>' being compiled
1>          with
1>          [
1>              Device=std::ifstream
1>          ]

Expected behavior

I want use gil for read jpeg line by line from istream

C++ Minimal Example

#include <fstream>
#include <boost/gil.hpp>
#include <boost/gil/extension/io/jpeg.hpp>
namespace gil = boost::gil;
int main
{
        using tag_t = gil::jpeg_tag;
	using reader_t = gil::scanline_reader<typename gil::get_read_device<std::istream, tag_t>::type, tag_t>;

	std::ifstream is("d:/test.jpg", std::ios::binary | std::ios::in);
		
	reader_t reader = gil::make_scanline_reader(is, tag_t()); //Here an error
}

Environment

Inside make_scanline_reader.hpp (line 84) - it seems function recursive:

template <typename Device, typename FormatTag>
inline
auto make_scanline_reader(Device& io_dev, FormatTag const&,
    typename std::enable_if
    <
        mp11::mp_and
        <
            detail::is_adaptable_input_device<FormatTag, Device>,
            is_format_tag<FormatTag>
        >::value
    >::type* /*dummy*/ = nullptr)
    -> typename get_scanline_reader<Device, FormatTag>::type
{
    return make_scanline_reader(io_dev, image_read_settings<FormatTag>());
}
  • Compiler version: msvc 16.9.1
  • Build settings: windows, 64bit
  • boost 1.75
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

No branches or pull requests

1 participant