Closed fsmoke closed 3 months ago
For now i wrote very ugly workaround - it's looks like very very bad!
namespace detail
{
//FIXME see BUG https://github.com/boostorg/gil/issues/724
template<>
class istream_device<jpeg_tag> : public istream_device<void>
{
public:
istream_device(std::istream & in) : istream_device<void>(in), _in(in) {}
long int tell()
{
auto pos = _in.tellg();
io_error_if(pos == -1L, "istream_device: file position error");
return (long int)pos;
}
private:
std::istream & _in;
};
}
so i'll waiting for your realization
as addition - specialization of devices very unclear - cos it's inside boost::gil::detail - i think it must be as public api
Yes, the tell()
method is indeed missing in boost::gil::detail::istream_device
. And in boost::gil::detail::ostream_device
. And so is the error()
method, too. I see that this can be problematic in cases like yours.
To fix this, I opened a PR that implements both of those methods for both of the mentioned classes, #747.
I am trying write custom io extension - and i need get size to the end of device(stream or file no matter) I already wrote all classes and tags for it, but it seems i found bug
i wrote following code to calc size
following code compiles just fine
but i'ev got error when use istream
error C2039: 'tell': is not a member of 'boost::gil::detail::istream_device'
i investigated boost_1_80_0\boost\gil\io\device.hpp - and it's true there is no tell method in istream_device class :( but in file_stream_device it's present.