boostorg / boostorg/gil

scanlne_reader for istream not worked

Open
#578 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
199
Forks
171
Avg merge
1d 14h
Merged PRs (30d)
10

Description

### 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'
1> with
1> [
1> T=std::ifstream,
1> FormatTag=boost::gil::image_read_settings
1> ]
1> d:\libraries\boost_1_75_0\boost\gil\io\get_reader.hpp(160): message : see declaration of 'boost::gil::get_read_device'
1> with
1> [
1> T=std::ifstream,
1> FormatTag=boost::gil::image_read_settings
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>' 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

```cpp
#include
#include
#include
namespace gil = boost::gil;
int main
{
using tag_t = gil::jpeg_tag;
using reader_t = gil::scanline_reader::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
inline
auto make_scanline_reader(Device& io_dev, FormatTag const&,
typename std::enable_if
<
mp11::mp_and
<
detail::is_adaptable_input_device,
is_format_tag
>::value
>::type* /*dummy*/ = nullptr)
-> typename get_scanline_reader::type
{
return make_scanline_reader(io_dev, image_read_settings());
}
```

- Compiler version: msvc 16.9.1
- Build settings: windows, 64bit
- boost 1.75

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.